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 is the use of dialect?
I have the choice of manipulating database data using a byte[] or a java.sql.blob. Which has best performance?
How can I retrieve a String or other object type without creating a new object each time?
Why do you use a data source object for a connection?
What are the steps required to execute a query in jdbc?
What is the full form of jdbc?
What is jdbc driver manager?
What is the use of jdbc api?
Discuss the procedure of retrieving warnings?
Is jdbc a middleware?
What is resultset?
Is jdbc object oriented?
Which of the attributes in the monitoring tab for a jdbc connection pool in the administrative console tell us how many clients are currently waiting for a connection?
What is jdbc and odbc in java?
How we store procedure in oralce for callable statements in jdbc