Skip to main content

CS506 Current Midterm Paper Fall 2013 File 13



1              whats the start do in applet cycle and when we use it
ans :
To start the applet's execution
• For example, when the applet's loaded or when the user revisits a page that contains the
applet
• start( ) is also called whenever the browser is maximized

2              .Write the syntax to load the oracle driver
ans:
Class.forName(“oracle.jdbc.driver.OracleDriver”);

3              what dose codes do

 ResultSet rs=TYPING_SCROLL_INSENSITIVE
ResultSet.TYPE_SCROLL_INSENSITIVE,

The following code fragment, illustrates how to make a ResultSet object that is scrollable and
updatable.
String sql = “SELECT * FROM Person”;
PreparedStatement pStmt = con.prepareStatement(sql,
ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs = pStmt.executeQuery( );
Two constants have been used of ResultSet class for producing a ResultSet rs that is
scrollable, will not show changes made by others and will be updatable

 4.            What DO MaxRows (int)    &  setMaxRows(int)   methods
• Used for determines the number of rows a ResultSet may contain
• By default, the number of rows are unlimited (return value is 0), or by using
setMaxRows(int), the number of rows can be specified.

5               write any five GUI based component
                1. BUTTON
                2. Label
                3. Text filed
                4.Text area

 6               define paint( ) in applet life cycle

• paint( ) is called for the first time when the applet becomes visible
• Whenever applet needs to be repainted, paint( ) is called again
• Do all your painting in paint( ), or in a method that is called from paint( )

 7.            what is and why we use : JDBC - ODBC Bridge

• Translates all JDBC calls into ODBC (Open Database Connectivity) calls and
send them to the ODBC Driver
• Generally used for Microsoft database.
• Performance is degraded

 8.            What is the difference b/w socket and server socket, also give a java syntax of socket and
Server socket. 5 mr

A socket is one endpoint of a two-way communication link between two programs
running generally on a network.

• A socket is a bi-directional communication channel between hosts. A computer on a
network often termed as host.
 
                The server listens through a special kind of socket, which is named as server socket.
• The sole purpose of the server socket is to listen for incoming request; it is not used
for communication

Syntex for socket
Socket s = new Socket(“serverName”, serverPort) ;

serverName: Name or address of the server you wanted to connect such as
http://www.google.com or 172.2.4.98 etc. For testing if you are running client and server
on the same machine then you can specify “localhost” as the name of server

• serverPort : Port number you want to connect to

Syntex for server socket

Create a Server Socket

In order to create a server socket, you will need to specify port no eventually on which server will listen for client requests.

ServerSocket ss = new ServerSocket(serverPort) ;

• serverPort: port local to the server i.e. a free port on the server machine. This is the same
port number that is given in the client socket constructor

 9              what is disadvantage of interfaces          

One disadvantage of interfaces is that one you publish them to other coders outside your own control, they represent a public commitment which can be difficult to change later. You don't know who else is using the interface and you don't know how, so you can't just add a new method to the interface without risking breaking the code of existing clients (if/when they upgrade). In comparison, if you'd used an abstract or concrete class, you could just add a new concrete method with no problems (usually).

It's possible to work around this b

Comments

Popular posts from this blog

CS504 Quiz No.3 Shared by Angel

Question # 1 of 10 ( Start time: 09:08:01 PM ) Total Marks: 1 Defining the services of an object means: Select correct option: What it does?        ok What it knows? Who knows it? Whome it knows? Question # 2 of 10 ( Start time: 09:08:27 PM ) Total Marks: 1 Which one of these represents the Krutchen’s 4+1 architectural view model? Select correct option: Logical view, Process view, Physical view, Development view, Use case view Logical view, Dynamic view, Physical view, Development view, Use case view Logical view, Process view, Physical view, Development view, Sequence view Dynamic view, Process view, Physical view, Development view, Use case view Question # 3 of 10 ( Start time: 09:09:50 PM ) Total Marks: 1 Return values in Synchronous messages are represented by: Select correct option: A solid line A dotted line with label        ok A solid line with label Double line Question # 4 of 10 ( Start tim...

CS302 Quiz No.4 Shared by Jawwad

Question # 1 of 10 ( Start time: 01:15:08 PM ) Total Marks: 1  Asynchronous mean that_____________  Select correct option:  Each flip-flop after the first one is enabled by the output of the preceding flip-flop  Each flip-flop is enabled by the output of the preceding flip-flop  Each flip-flop except the last one is enabled by the output of the preceding flip-flop  Each alternative flip-flop after the first one is enabled by Question # 2 of 10 ( Start time: 01:16:36 PM ) Total Marks: 1 A divide-by-10 ring counter requires a minimum of Select correct option: ten flip-flops five flip-flops four flip-flops twelve flip-flops Question # 3 of 10 ( Start time: 01:17:00 PM ) Total Marks: 1 When the number of states are reduced during the design any counter Select correct option: output changes and Input remain unchanged Input changes and output remain unchanged Input and output bith change Input and output remain unchanged Question # 4 of...

CS614 Quiz No.1 Shared by Manzar (UnSolved)

Question # 1 of 10 ( Start time: 03:35:24 PM )   Total Marks: 1 MDX by Microsoft is an example of _______ Select correct option: HOLAP DOLAP ROLAP None of the given options Question # 2 of 10 ( Start time: 03:36:40 PM )   Total Marks: 1 In decision support system ease of use is achieved by: Select correct option: Normalization Denormalization Drill up Drill down Question # 3 of 10 ( Start time: 03:38:07 PM )   Total Marks: 1 Which of the denormalization technique squeezes master table into detail? Select correct option: Pre-joining Horizontal splitting Vertical splitting Adding redundant column Question # 4 of 10 ( Start time: 03:38:28 PM )   Total Marks: 1 The trade-offs of denormalization is/are: Select correct option: Storage Performance Ease-of-use All of the given options Question # 5 of 10 ( Start time: 03:38:46 PM )   Total Marks: 1 ________is usually deployed when expressions can be used to group data together in...