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
How do I receive a ResultSet from a stored procedure?
What is the use of statement in jdbc?
What is executequery in java?
There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?
Where is mysql jdbc driver located?
How can we store the file in the oracle database?
What is jdbc connection interface?
What is a jdbc connection pool?
Which jdbc drivers will run your program?
What are different parts of a url?
Why isn't the java.sql.DriverManager class being found?
What are the advantages of using jdbc datasource?
How to move the cursor in scrollable resultset ?
How can we retrieve the file in the oracle database?
How do you determine the sensitivity of the ResultSet object?