java

50 pts.
Tags:
Java
Java Database
MySQL admin
SQL Server
Can u tell me how to connectivity in java & oracle / my sql. I know connectivity in java & Ms Access. But i want to connect java & oracle. Pls give each & every steps. Bcause i'll be connecting 1st time.

Pls tell me all settings & which file for connect & .......



Software/Hardware used:
Java 1.6

Answer Wiki

Thanks. We'll let you know when a new response is added.

First u have install Oracle as well as java. I guess u know how to install & configure them both. after successful u insert the code below in ur java code. U must create a database in oracle to which u connect with java :-

Connection connection = null;
// Load the JDBC driver
try {
String driverName = “oracle.jdbc.driver.OracleDriver”;
Class.forName(driverName);
// Create a connection to the database
String serverName = “127.0.0.1”;
String portNumber = “1521”;
String sid = “mydatabase”;
String url = “jdbc:oracle:thin:@” + serverName + “:” + portNumber + “:” + sid;
String username = “username”; String password = “password”; connection = DriverManager.getConnection(url, username, password); }
// Could not find the database driver
catch (ClassNotFoundException e) {
}
// Could not connect to the database
catch (SQLException e) { }

Good Luck !

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following