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 connection commit?
What is jdbc explain?
How to connect html page to database using jdbc?
What is jdbc and odbc in java?
What are the conditions applies to varchar variable, when using in procedures?
What is jdbc stand for?
What are devices?
Give steps to connect to the db using jdbc?
What are the new features added to JDBC 4.0?
What are the steps to connect to the database in java?
What is an SQL Locator?
What do you understand by jdbc datasource?
Where is jdbc used?
How to achieve JDBC Connection Pooling using JDBC DataSource and JNDI in Apache Tomcat Server?
Is jdbc and orm?