how can connection with oracle10g with java
Answer Posted / kishan
package dao;
import java.sql.Connection;
import java.sql.DriverManager;
public class Database {
static final String USERNAME="hr";
static final String PASSWORD="hr";
public static Connection getConnection()
{
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection
("jdbc:oracle:thin:@localhost:1521:XE",
USERNAME, PASSWORD);
return con;
}
catch(Exception ex) {
System.out.println(ex.getMessage());
return null;
}
}
}
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
Which package is used for jdbc application?
How can I create a custom RowSetMetaData object from scratch?
What is the difference between setmaxrows(int) and setfetchsize(int)?
Is jdbc object oriented?
Under what circumstances, that all four drivers are used?
What is the meaning of batch updates?
What is the purpose of the jdbc resultset interface?
Can we return resultset in java?
How we store procedure in oralce for callable statements in jdbc
What are the higher level apis under development on top of jdbc currently?
What is connection data?
What is a jdbc url?
What are the three parts of a jdbc url?
What are the advantages of database connection pooling?
What is difference between statement and preparedstatement in jdbc?