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
What are the jdbc statements?
What are the differences between stored procedure and functions?
Does jdbc use ssl?
If you are truncated using JDBC, how can you that how much data is truncated?
What is a java driver?
What is an advantage of using the jdbc connection pool?
What is com mysql jdbc driver?
What is while rs next ())?
What does the jdbc resultsetmetadata interface?
What are the steps required to execute a query in jdbc?
How can you make a connection?
What does jdbc stand for?
What class.forname does, while loading the drivers?
What is jdbc and odbc in java?
What are the packages are used in jdbc?