50 pts.
 java
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
ASKED: August 6, 2010  3:50 PM
UPDATED: October 21, 2010  9:36 AM

Answer Wiki:
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 !
Last Wiki Answer Submitted:  October 21, 2010  9:36 am  by  Subhendu Sen   22,035 pts.
All Answer Wiki Contributors:  Subhendu Sen   22,035 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _