GeekInterview.com
Series: Subject: Topic:

JDBC Interview Questions

Showing Questions 1 - 20 of 148 Questions
First | Prev | | Next | Last Page
Sort by: 
 | 

JDBC provides facility to store the Java objects by using following methods of the preparedstatement.1. Setobject ()2. Setblob()3. Setclob()

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) 1,2b) 2,3c) 1,3d) 1,2,3

Answered by: meenakshi on: Apr 1st, 2013

1,2,3

Answered by: satheesh kumar. sriramaneni on: May 4th, 2006

D is the answer. These three methods are used to store the objects.

What’s the difference between type_scroll_insensitive , and type_scroll_sensitive?

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) a result set that is type_scroll_insensitive does not reflect changes made while it is still open and one that is type_scroll_sensitive does.B) both types of result sets will make changes visible if they are closed and then reopened.C) you will get a scrollable resultset object if you specify one...

Answered by: vk payne on: Feb 7th, 2013

A,B and D
All the three are correct

Answered by: vinaymudgil007 on: Jun 8th, 2010

The wrong option and hence the correct answer is (d)

Which of the following statement is true for the type 2 JDBC driver?

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) a type 2 driver converts JDBC calls into calls for a specific database.B) this driver is referred to as a "native-api, partly Java driver."c) as with the type 1 driver, some binary code may be required on the client machine, which means this type of driver is not suitable for downloading over a network...

Answered by: Supriya on: Dec 2nd, 2012

B) This driver is referred to as a "native-API, partly Java driver."

Answered by: fincy on: Sep 3rd, 2007

B & C is correct

What is the difference between executeupdate() and executequery() in JDBC ?

Asked By: mailmeatsridhar | Asked On: Sep 12th, 2011

Answered by: Manohar on: Nov 2nd, 2012

executeUpdate() is ment for Non-Select Statements,,and it returns Update Count as an int value.

executeQuery() is ment for Select Statements, and it returns ResultSet.

Answered by: MeenaDeepak on: May 21st, 2012

executeQuery() is used for Select statements.
executeUodate() is used for insert,update,delete statements..

JDBC - pre compile and sored procedure

Asked By: Sonam | Asked On: Nov 24th, 2011

As prepare statement also precompiles the SQL stmt & stored procedure also compiles the stmt once &den execute the same,then what is the diff between these 2 stmts?

Answered by: Murali100 on: Oct 7th, 2012

The difference between these two statements are
1) SQL Query will be compiled every time it is executed. whereas Stored Procedures are compiled only once when they are executed for the first time
2) Stored Procedure is efficient & fast execution than SQL query

What is difference b/w type-1 and type-4 JDBC driver with example ?

Asked By: timmireddy | Asked On: Jul 14th, 2008

Give me brief description with small example

Answered by: Suman Kumar Thati on: Oct 5th, 2012

JDBC-ODBC Bridge is a type 1 JDBC driver which converts JDBC operations in to C language ODBC APIs and then ODBC calls are then passed to appropriate ODBC driver.

Answered by: dasavtar on: Jan 25th, 2011

Type1: JDBC-ODBC Bridge driverThis is a "birdge" driver, Translates all JDBC calls into ODBC calls and sends them to ODBC driver and ODBC inturn will communicate with a database. The Java Na...

Fill in the blanks -- the full form of JDBC is _________________

Asked By: Interview Candidate | Asked On: Dec 10th, 2005

A) Java database connectivity

Answered by: sujith on: Sep 28th, 2012

No it does not contain any full form. It is Java based data access technology and we use it as Java database connectivity for our convenience.

Answered by: Atul Sonkar on: Jun 5th, 2006

JAVA DATABASE CONNECTIVITY

How do you save a Java object in database

Asked By: Subhash | Asked On: Sep 11th, 2007

Answered by: koti on: Sep 9th, 2012

u store the object of a class in database. but database is meant for storing the values in the table format. for that reason only sun introduced JNDI for storing the object. by using this concept u can store the object in registry software. with that u can provide the global visibility also

Answered by: jingboliu on: Sep 24th, 2007

1. Please make sure the java object is serializable
2. Serialize the java object into a file
3. Store the content of the file to relational database as Blob

What is connection pooling

Asked By: Interview Candidate | Asked On: Aug 26th, 2005

Answered by: Chandan on: Jun 20th, 2012

Connection pooling is a technique using which we can get the precreated connection object from the connection pool.After using that connection object, the connection object is released to the pool fo...

Answered by: Suresh Yerra on: Dec 11th, 2011

Usually Acquiring the connection is time consumption task. In order to avoid that situations, we are reusing already created connection objects. This requirement doesnot support DriverManager interface, we have interface DataSource in javax.sql package.

What is the most common example type 1 driver

Asked By: lalchand87 | Asked On: Sep 27th, 2011

Answered by: chandrika soni on: Apr 2nd, 2012

Java Native Interface (JNI)

JDBC - update many table on single submit

Asked By: rjk1203 | Asked On: Oct 31st, 2011

How to achieve a single value from web page to be updated/stored in many tables ?

Answered by: sekhar on: Mar 15th, 2012

To update data in multiple table using single click ,we can go with triggers in database.we have different types of triggers like after insert,after update,after delete.Better using triggers.

Answered by: G S on: Nov 3rd, 2011

By using Transactions.

Every JDBC Driver will be able to perform Transactions. But its not recommended.

If we want to use out own Transactions we will set

con.setAutoCommit(false); and after executing the transactions we will execute con.commit();

What is the difference between resultset and rowset

Asked By: Interview Candidate | Asked On: Sep 5th, 2005

Answered by: Sekhar on: Mar 15th, 2012

ResultSet rs; where rs is treat like a cursor to a database.if the connection is alive then only we can retrieve the information through resultset object.

RowSet rs;We can retrieve data through rowset object with out depending upon the connection is alive or not.

Answered by: sudhakar on: Oct 15th, 2005

If the connection is alive, then only the values remain in a ResultSet, where as in RowSet,once we get the results connection need not be alive. 

JDBC retrieve row

Asked By: Maverik057 | Asked On: Sep 28th, 2011

How can we retrieve a whole row of data at once in JDBC ?

Answered by: karthikdivi on: Jan 17th, 2012

As of now it is not possible.

1.Why constructor does not have return type in Java?2.Why static does not support " this" and "super" keyword in Java ?3.Which one is better to create a thread by implementing runnable or by extending...

Asked By: senthilD | Asked On: Apr 30th, 2006

Answered by: Sourav Agrawal on: Oct 22nd, 2011

Constructor does not have any return type .. the answer is ,we don't have ny rights to call constructor , we can't invoke the constructor but at the type of object creation constructor automatically g...

Answered by: Achal singh rathore on: Sep 16th, 2011

"c class hello { void hello(int x) { System.out.print("hi"); } } class main { public static void main(String[] s) { hello ab=new hello(); ...

Retrieving data methods

Asked By: Koshala Deepal | Asked On: Jun 18th, 2011

What methods did you use for retrieving data form a resultset object

Answered by: Mohit Pabari on: Oct 6th, 2011

The getX() method is used, where X is String or Int depending on the type used in the database.

Answered by: debasish padhy on: Jul 14th, 2011

getString() method is used to retrieve data from the resultset

Setup datasource

Asked By: lalchand87 | Asked On: Sep 28th, 2011

What must be done by the system administrator in order for a programmer to use the data source?

If you dont close a connection in a web application, what will happen?

Asked By: surbhi jain | Asked On: Aug 22nd, 2007

Answered by: madhu on: Sep 5th, 2011

Always you should close connection. In some cases exception is thrown. When more processes get active in the same.

Answered by: anand chaubey on: Aug 7th, 2011

If you don't close the connection,your application will eat up all your connection and your application will run out of connection and server will give error as no active connection and your application won't work.

What are the three statements in JDBC & differences between them

Asked By: Interview Candidate | Asked On: Aug 26th, 2005

Answered by jey on 2005-05-10 05:53:50: 1.Statement which is used to run simple SQL statements like select and update 2. Preparestatment is used to run pre compiled SQL.  3. Callablestatement is used to execute the stored procedures.

Answered by: Naveen Sharma on: Jul 31st, 2011

class.forname is used to load a class.
When we are making database connectivity then class.forname(................) must be the first statement.

Answered by: Harish Chevuri on: Jun 3rd, 2011

three statements in jdbc1. statement : whic is used to execute select and non select queries.2. PreapreStatement : which is also used to execute select and non select queries but PrepareStatement whic...

SQL query using JDBC

Asked By: sankalpshah06 | Asked On: Jun 28th, 2011

When you execute a SQL query using JDBC, do you get a complete recordset or the partial recordset?

What class.Forname( ) method will do

Asked By: Interview Candidate | Asked On: Aug 8th, 2005

Answered by jey ramasamy on 2005-05-10 05:50:07: class.Forname() is used to load the driver class which is used to connect the application with database. Here driver class is a Java class provided by database vendor.

Answered by: sankalpshah06 on: Jun 21st, 2011

It is used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a Database.

Answered by: ashwin1483 on: May 15th, 2008

Class.forName is used to create an instance of the driver and register with the DriverManager.

First | Prev | | Next | Last Page

 

 

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.