File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes cannot connect to oracle using datadirect JDBC driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "cannot connect to oracle using datadirect JDBC driver" Watch "cannot connect to oracle using datadirect JDBC driver" New topic
Author

cannot connect to oracle using datadirect JDBC driver

Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
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
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
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: 265
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot connect to oracle using datadirect JDBC driver