How do you create Connection?

Answer Posted / p.kodanda rami reddy

After loading the driver in order to refer the what kind of
database u communicate we Establish the connection with the
help of a static method called GETCONNECTION this is from
DRIVER MAMAGER.GETCONNECTION. accepting arguments as JDBC
URL ,USER NAME , PASSWORD
EX: DriverManager.getConnection
("jdbc:odbc:sid","scott","tiger");
here jdbc,odbc,sid -> is url and sid is service id.
scott - > is user name.
tiger - > is password.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a jdbc connection string?

466


Is it possible to connect to multiple databases? Using single statement can we update or extract data from two or three or many databases?

591


What is resultset in jdbc with example?

499


please tell me the name and url path for type-4 driver ?

2481


How do java applications access the database using jdbc?

536






What are the different types of statements? How we can you use preparedstatement.

517


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

554


Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?

569


What do you understand by jdbc statements?

517


What is jdbc connection class?

476


Under what circumstances, that all four drivers are used?

1907


Can I get a null resultset?

555


What are JDBC Best Practices?

555


DB2 Universal claims to support JDBC 2.0, But I can only get JDBC 1.0 functionality. What can I do?

590


What are different types of JDBC Drivers?

536