Explain the necessary steps to connect to the database in java?



Explain the necessary steps to connect to the database in java?..

Answer / A. Vinoth Saravanan

To connect to a database in Java using JDBC, you need to follow these steps:
1. Load the JDBC driver class.
2. Establish a connection with the database using the DriverManager or DataSource.
3. Send SQL queries and process the results.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JDBC Interview Questions

I have the choice of manipulating database data using a byte[] or a java.sql.blob. Which has best performance?

1 Answers  


How is jndi useful for Database connection?

1 Answers  


Does jpa use jdbc?

1 Answers  


How can we store and retrieve images from the database?

1 Answers  


What are the ddl statements?

1 Answers  


Statement, PrepareStatement and Callable all these are interfaces. Thought it is a interface how come we are creating objects and calling methods("preparestatement()") in it. In which class this method is defined. Please let me know. Thanks in advance. example: PreparedStatement pre = con.prepareStatement( "UPDATE COFFEES SET SALES = ? WHERE COF_NAME LIKE ?");

2 Answers  


What is jdbc databasemetadata interface?

1 Answers  


How do I retrieve a whole row of data at once, instead of calling an individual ResultSet.getXXX method for each column?

1 Answers  


Why isn't the java.sql.DriverManager class being found?

1 Answers  


Name the new features added in jdbc 4.0.

1 Answers  


Why do we need a jdbcrowset like wrapper around resultset?

1 Answers  


What is 2 phase commit?

1 Answers  


Categories