Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

CS506 Current Mid Term Papers Spring 2014 & Past Mid Term Papers at One Place Date: June 07 to June 18, 2014

All Current Mid Term Papers Spring 2014 and Past Mid Term Papers at One Place From June 07 to June 18, 2014.

Share Your Mid Term Papers Here in Reply of this Discussion

May Allah Solve Our Problems and Give Us Success

You Can Download Solved Mid Term Papers, Short Notes, Lecture Wise Questions Answers Files, Solved MCQs, Solved Quizzes , Solved Mid Term Subjective Papers , Solved Mid Term Objective Papers From This Discussion For Preparation Mid Term Paper of Spring 2014

For Important Helping Material related to this subject (Solved MCQs, Short Notes, Solved past Papers, E-Books, FAQ,Short Questions Answers & more). You must view all the featured Discussion in this subject group.

For how you can view all the Featured discussions click on the Back to Subject Name Discussions link below the title of this Discussion & then under featured Discussion corner click on the view all link.

Or visit this link 

Click Here For Detail.

Thanks and Regards,

VU Students.ning Social Network.

Views: 4452

Replies to This Discussion

My today paper

Which method will be called to paint each component? 5marks

Components

Methods

Custom shape

?

Button

?

Border                                   

?

Background

?

Question ye code dia tha just correct krna tha marks 5

1. import java.awt.*;

2. import javax.swing.*;

/* Implementing the interface according to the type of the event,

i.e. creating event handler (first part of step 2 of our process)

*/

4. public class ActionEventTest implements ActionListener{

5. JFrame frame;

6. JButton hello;

// setting layout components

7. public void initGUI ( ) {

8. frame = new JFrame();

9. Container cont = frame.getContentPane();

10. cont.setLayout(new FlowLayout());

//Creating event generator step-1 of our process

/* Registering event handler with event generator.

Since event handler is in same object that contains

button, we have used this to pass the reference.(step

3 of the process) */

13. cont.add(hello);

14. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

15. frame.setSize(150, 150);

16. frame.setVisible(true);

17. }

//constructor

18. public ActionEventTest ( ) {

19. initGUI();

20. }

/* Override actionPerformed method of ActionListener’s

interfacemethod of which will be called when event

takes place (second part of step 2 of our process) */

23. }

24. public static void main(String args[]) {

25. ActionEventTest aeTest = new ActionEventTest();

26. }

27.} // end class

Q. How JVM behave when event handling components interact behind the scene?

Q. How resultset return only 100 rows?

It is possible to get data type of a specific column in result?

Q. We use stream over network to send piece of data .What is a solution for this that is easy to implement? How your proposed solution benefits us?

 Ahmed Thanks for sharing ur paper..best of luck for ur result 

Ahmed  Thanks for sharing 

Some current Papers solved.

Attachments:

Wet Ey3$  Gud keep it up & thanks for sharing 

CS506_Spring_2014_Midterm (Solved)

 

Write the code to make connection with MS Access Database?

Answer:

  1. Import Required Package as “import java.sql.*;”
  2. Load Driver as “Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);”
  3. Define Connection URL as “String conURL = “jdbc:odbc:personDSN”;”
  4. Establish Connection with Database as “Connection con = null;con = DriverManager.getConnection(conURL, usr, pwd);”

 

What is Difference between HTML & Applet View?

Answer: Page 184

The applet viewer is invoked from the command line by the command

appletviewer htmlfile where htmlfile is the name of the file that contains the html document.

 

Write code for change the name Ali as a Ahmed from Database from 5th Row?

Answer:

 

import java.sql.*;

public class ResultSetEx {

public static void main (String args[ ]) {

try {

 

Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);

 

String url = “jdbc:odbc:personDSN”;

 

Connection con = DriverManager.getConnection(url);

 

String sql = “SELECT * FROM Person”;

PreparedStatement pStmt = con.prepareStatement(sql,

ResultSet.TYPE_SCROLL_INSENSITIVE,

ResultSet.CONCUR_UPDATABLE);

 

ResultSet rs = pStmt.executeQuery();

 

rs.absolute(5);

 

rs.updateString(“Name”, “Ahmed”);

 

rs.updateRow( );

 

con.close();

}catch(Exception sqlEx){

System.out.println(sqlEx);

}

}

}

 

What are the functions of Paint Methods?

Answer:

These three are the main functions of paint.

paintComponent( )

paintBorder( )

paintChildren( )

---

paintComponent( )

  • • It is a main method for painting
  • • By default, it first paints the background
  • • After that, it performs custom painting (drawing circle, rectangles etc.)

paintBorder( )

  • • Tells the components border (if any) to paint.
  • • It is suggested that you do not override or invoke this method

paintChildren( )

  • • Tells any components contained by this component to paint themselves
  • • It is suggested that you do not override or invoke this method too.

 

Characteristics of Result Set? 5 Marks

Page 156

A ResultSet contains the results of the SQL query

o Represented by a table with rows and columns

o Maintains a cursor pointing to its current row of data.

o Initially the cursor positioned before the row (0).

o First row has index 1

 

How to Display data from database write code?

Answer:

  1. Import Required Package as “import java.sql.*;”
  2. Load Driver as “Class.forName(“sun.jdbc.odbc.JdbcOdbcDriver”);”
  3. Define Connection URL as “String conURL = “jdbc:odbc:personDSN”;”
  4. Establish Connection with Database as “Connection con = null;con = DriverManager.getConnection(conURL, usr, pwd);”
  5. Create Statement as “Statement stmt = con.createStatement( );  ”
  6. Execute a Query

String sql = “SELECT * from sometable”;

ResultSet rs = stmt.executeQuery(sql);

  1. Process Results of the Query
  2. Close the Connection

con.close(); 

 

How JVM behave when event handling components interact behind the scene?

Answer: Page 118

Receives an event whenever one is generated

  • • Looks for the listener/handler of that event
  • • If exist, delegate it for processing
  • • If not, discard it (event).

When button generates an ActionEvent it is sent to JVM which puts it in an event queue.

After that when JVM find it appropriate it de-queue the event object and send it to all the

listeners that are registered with that button

 

How result set return only 100 rows?

Answer:

Resultset can return 100 rows by the following statement:

setMaxRows(100);

 

It is possible to get data type of a specific column in result?

Answer: Yes it is possible by the following statement

ResultSetMetaData rsmd = rs.getMetaData();

 

Which method will be called to paint each component? 5marks

Answer:

Components

Methods

Custom shape

paintComponent( )

Button

JComponent

Border                                   

paintBorder( )

Background

paintComponent( )

 

We use stream over network to send piece of data .What is a solution for this that is easy to implement? How your proposed solution benefits us?

well done

any body share solved quiz 1 and quiz 2 file of current semester

my cs506 paper

if you are writing an applet code, then what is the best place to write the main method code in applet java file? 2marks

why type-2 driver is efficient as compared to jdbc-odbc bridge? 2marks

ResultSet code error finding. 3marks

table was given, write code of while loop to retrieve values from that table using result set. 5marks

write MouseListener code for 'Mouse Clicked' and 'Mouse Exited". 5marks

aik question yaad nai araha sorry....

Thanks

MCQs were too much easy..

1. Difference between client server and socket server. (2 marks)

2. Why we commit DML statement for... agy se bhool gya  (2 marks)

3. Write three limitations of default ResultSet object. (3 marks)

4. Why type-4 driver is more efficient? Why is it called thin-driver? (3 marks)

5. Write adapter classes for given listener interfaces. (5 marks)

Listener Interfaces

Adapter Classes

ActionListener

 

ItemListener

 

AdjustmentListener

 

TextListener

 

6. Write a code in which paint brush draws a circle also add an event of MouseMotionListener in which if the mouse dragged it draws circle throughout. (Code structure was given we just have to write objects). (5 marks)

RSS

Looking For Something? Search Below

Top Trends 

Latest Activity

Sophie and Adeel are now friends
51 minutes ago
kashifali commented on + M.Tariq Malik's page Chit Chat Wall
17 hours ago
kashifali liked Momna Arshad's profile
17 hours ago
kashifali left a comment for Momna Arshad
17 hours ago
kashifali left a comment for jiya ali
17 hours ago
kashifali left a comment for jiya ali
17 hours ago
Golden Eye liked Black Bird Scientist's discussion graphic designer required
20 hours ago
Momna Arshad and +** KAKAR **+ are now friends
21 hours ago

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service