perfect_tranquility
asked on
JDBC with Oracle:Driver Class?
I have been trying to establish a connection to Oracle database in my company and I can not even load the driver class. Can someone help plz?
The host string ,port number, user name and passwords are all fine as I used them to log thru SQL Tools.
The host string ,port number, user name and passwords are all fine as I used them to log thru SQL Tools.
package package1;
import java.sql.*;
public class class1 {
private void f() {
try{
//Class.forName("jdbc:oracle:thin");
Class.forName("oracle.jdbc.driver.OracleDriver");
}
catch(ClassNotFoundException e){
System.out.println("Driver not loaded");
}
String url = "oracle.jdbc.driver.OracleDriver:@144.226.202.69:1521:CCRP";
try{
Connection con=DriverManager.getConnection(url, "COMM_USER","APP0NLY");
Statement stmt=con.createStatement();
ResultSet rs=stmt.executeQuery("select * from stage2");
System.out.println(rs.getType());
}
catch(SQLException e){
System.out.println("Connection could not be established");
}
}
public static void main(String[]fdfd){
new class1().f();
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
no problem, plz give me a day or two. I will check both of them out and come back. I have always been just in giving points, not to worry friends.
Thank you Venabili:. I had not read your links before posting.:-) Sorry :-)
By the way I'm not a expert i just wanted to help him as i also faced exactly same :-)
perfect_tranquility, I DONT want any points you can award Venabili full points. :-)
By the way I'm not a expert i just wanted to help him as i also faced exactly same :-)
perfect_tranquility, I DONT want any points you can award Venabili full points. :-)
rks_86, it's not about the points :) The whole idea is to work as a team so... try to read what is already posted before jumping in a question (and this is in the rules by the way) :) PS: Did you see why your code does not compile? :)
perfect_tranquility, Sure. let me know if you need more assistance
perfect_tranquility, Sure. let me know if you need more assistance
Syntax error right
ASKER
Please bear with me, I will be doing all this JDBC stuff on weekend, this way, I shall memorize it all for ever!
Thanks
Thanks
Not to mention that it does not add anything to what I posted days ago... So what was the point in posting it?