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 Relational Databases and the fly likes invalid driver designator error ..please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "invalid driver designator error ..please help" Watch "invalid driver designator error ..please help" New topic
Author

invalid driver designator error ..please help

sai Narayan
Greenhorn

Joined: Aug 16, 2004
Posts: 21
when i run my code i get the following error:-
code:-
import java.io.* ;
import java.sql.*;
import java.util.*;
import oracle.sql.*;
import oracle.jdbc.*;



class javadbconn{


public static void main(String arg[]) throws java.io.IOException
{

Connection connection = null;
try {
// Load the JDBC driver
Class.forName("oracle.jdbc.driver.OracleDriver");

// Create a connection to the database
connection =

DriverManager.getConnection("jdbc : oracle : oci8:@samit:1521:asid","scott","tiger");


} catch (ClassNotFoundException e) {
// Could not find the database driver
e.printStackTrace();
} catch (SQLException e) {
// Could not connect to the database
e.printStackTrace();

}
}
}

error:-
java.sql.SQLException: ORA-06401: NETCMN: invalid driver designator

at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:184)
at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1774)
at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:462)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:353)

at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:457)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:332)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:177)
at javadbconn.main(javadbconn.java:32)

the client side oracle version is as follows:-
Oracle9i Enterprise Edition Release 9.0.1.5.1 - Production
With the Partitioning option
JServer Release 9.0.1.4.0 - Production


[ October 13, 2004: Message edited by: sai Narayan ]
[ October 13, 2004: Message edited by: sai Narayan ]
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1082

I think classes12.zip is in your classpath

change the line

DriverManager.getConnection("jdbc racle ci8:@samit:1521:asid","scott","tiger");

to

DriverManager.getConnection("jdbc : oracle : thin:@samit:1521:asid","scott","tiger");

It will work and change the @samit to @IP_ADRESS_OF_MACHINE


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
sai Narayan
Greenhorn

Joined: Aug 16, 2004
Posts: 21
hi sailesh
thankyou very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invalid driver designator error ..please help