Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do I receive a ResultSet from a stored procedure?

1012


What is the use of statement in jdbc?

984


What is executequery in java?

944


There is a method getColumnCount in the JDBC API. Is there a similar method to find the number of rows in a result set?

1093


Where is mysql jdbc driver located?

1082


How can we store the file in the oracle database?

980


What is jdbc connection interface?

1076


What is a jdbc connection pool?

997


Which jdbc drivers will run your program?

981


What are different parts of a url?

1051


Why isn't the java.sql.DriverManager class being found?

1039


What are the advantages of using jdbc datasource?

1025


How to move the cursor in scrollable resultset ?

1087


How can we retrieve the file in the oracle database?

1010


How do you determine the sensitivity of the ResultSet object?

1027