cannot connect to oracle using datadirect JDBC driver
Graham Thorpe
Ranch Hand
Joined: Mar 25, 2002
Posts: 264
posted
0
hello , can anybody help me here i got a problem in connecting to oracle using datadirect jdbc driver. this is the code i wrote below import java.sql.*; import java.util.*; import java.io.*; public class connect { public static void main(String args[]) { try{ Class.forName ("com.ddtek.jdbc.oracle.OracleDriver"); Connection con=DriverManager.getConnection ("jdbc dtek racle://localhost:1521;User=scott ;Password=tiger"); System.out.println("Connected...!"+con); } catch(Exception e) { System.out.println("Exception is :"+e); } }} the error i found is : ---------------------- Exception is : java.sql.SQLException: No suitable driver as i already have the oracle driver class when i downloaded datadirect driver com\ddtek\jdbc\oracle\oracledriver.class Ur response is highly appreciated... thank u..
Dave Vick
Ranch Hand
Joined: May 10, 2001
Posts: 3244
posted
0
glkrrr I asked you read our naming policy yesterday. Please do so now and change you display name. Or we'll be forced to lock your account and you'll have to reregister completely. Thanks
Dave
Dave Vick
Ranch Hand
Joined: May 10, 2001
Posts: 3244
posted
0
As far as your error message it sounds like there are no drivers you have loaded that are recognizing the jdbc url you're trying to connect to. Check out the documentation for the driver and see what it is looking for in a URL.
Graham Thorpe
Ranch Hand
Joined: Mar 25, 2002
Posts: 264
posted
0
thank u mr. dave.. i already had oracle driver in my classpath as it comes along with datadirect jdbc driver and i got no compilation error but giving run time error. well, it works fine with sql server when url of my code is as below: Class.forName("com.ddtek.jdbc.sqlserver.SQLServerDriver"); Connection con=DriverManager.getConnection("jdbc atadirect:sqlserver://glkrr:1433;User=sa"); but whereas for Oracle its giving runtime error as no suitable driver for this code below: Class.forName("com.ddtek.jdbc.oracle.OracleDriver"); Connection con=DriverManager.getConnection("jdbc atadirect racle://localhost:1521;User=scott;Password=tiger"); where my SID=ORCL so, where can i use ORCL string to place. is it in place of localhost..? or where thanks for the response.
subject: cannot connect to oracle using datadirect JDBC driver