Java Database Connectivity Interview Questions and Answers

Java Database Questions and Answers:

1 :: How do you get Column names only for a table (SQL Server)?

Write the Query. -

select name from syscolumns
where id=(select id from sysobjects where name='user_hdr')
order by colid --user_hdr is the table name
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

2 :: What are collection pools? What are the advantages?

A connection pool is a cache of database connections that is maintained in memory, so that the connections may be reused
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 1 No
Place Your Answer

3 :: What is a data source (DS)?

A DataSource class brings another level of abstraction than directly using a connection object. Data source can be referenced by JNDI. Data Source may point to RDBMS, file System , any DBMS etc.
0/5 Rating (0 vote)
Is This Answer Correct?    1 Yes 0 No
Place Your Answer

4 :: What is the normal procedure followed by a java client to access the db?

The database connection is created in 3 steps:
1. Find a proper database URL
2. Load the database driver
3. Ask the Java DriverManager class to open a connection to your database

In java code, the steps are realized in code as follows:
1. Create a properly formatted JDBR URL for your database. (See FAQ on JDBC URL for more information). A JDBC URL has the form
jdbc:someSubProtocol://myDatabaseServer/theDatabaseName
2. Class.forName(”my.database.driver”);
3. Connection conn = DriverManager.getConnection(”a.JDBC.URL”, “databaseLogin”,”databasePassword”)
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

5 :: How do you handle your own transaction?

Connection Object has a method called setAutocommit(Boolean istrue)
Default is true. Set the Parameter to false , and begin your transaction
0/5 Rating (0 vote)
Is This Answer Correct?    0 Yes 0 No
Place Your Answer

Rate This Category:
0/5 Rating (0 vote)
Place Your Question



Top: Java Database Connectivity Interview Questions and Answers
Java Database Connectivity Interview Questions and Answers

Top Frequently Asked Java Database Question
Frequently Asked Java Database Job Interview Question


Top Frequently opened Databases Programming Job Interview categories
Most popular Databases Programming Job Interview categories

Comments About Java Database Connectivity Interview Questions and Answers

Share your valuable opinions, ideas and suggestions about Java Database Connectivity Interview Questions and Answers
While placing your comment your email address is required but won't be published any where else; Personal information will be kept confidential; we do not sell or release our respective visitors private information.
  1. Webmaster 22nd of May 2012

    Webmaster Said

    Tell us what you feel about Java Database Connectivity Interview Questions and Answers
    All comments will be published after review. No login or registration is required to post a comment on Java Database Connectivity Interview Questions and Answers We offer and invite you to submit your valuable comment now; Please be respectful of others when commenting. Insulting others, self-promotional comments, website promotional comments, marketing stuff, SEO Techniques, SMS-style content and off-topic comments will not be approved at this information portal.
    So start sharing your thoughts regarding Java Database Connectivity Interview Questions and Answers
    Thank you.

Leave a Comment

Leave a Comment
  1.  Enter This Verification Code  Regenerate Verification Code  



Your reply will be added to the comment above (Below any other replies to this comment) -

Top Comments About: Java Database Connectivity Interview Questions and Answers
Comments on Java Database Connectivity Interview Questions and Answers

 
Top of Link batk to Java Database Connectivity Interview Questions and Answers
Link batk to Java Database Connectivity Interview Questions and Answers