cancel
Showing results for 
Search instead for 
Did you mean: 

Correct URL syntax for Oracle JDBC Driver

Former Member
0 Kudos

Hi,

I have a stateless session bean that attempts to send a

query to an Oracle database. I am getting a

"java.sql.SQLException: No suitable driver" exception,

which I understand usually indicates that the class

loader found the JDBC driver class (classes12.zip is in

the Java build path), but the syntax of the URL

connection string isn't correct.

This is the way the code initializes the driver and url

parameters (cs is an IConnectionSpec object):

cs.setPropertyValue("driver", "oracle.jdbc.driver.OracleDriver");
cs.setPropertyValue("url", "jdbc:oracle:thin:@host:1521:orcl" ); 

I have also tried using "oracle.jdbc.OracleDriver" for

the driver, as specified in

http://cfguru.daemon.com.au/archives/000078.html, but to

no avail. The URL syntax is consistent with the syntax

described in the same link, so is there some other

explanation for this exception? Or is there an

inconsistency or error with the way the url

is specified?

Thanks for any help with this,

Colm.

Accepted Solutions (0)

Answers (2)

Answers (2)

katarzyna_fecht
Explorer
0 Kudos

Hi,

you use session beans this means you use a j2ee server (SAP NW Application server java aka j2ee engine for example).

On a j2ee server yo do not access database drivers directly. Instead you configure a server side jdbc datasource, later on your app is looking it up via jndi.

Please follow the NW documentation:

configuring datasources:

http://help.sap.com/saphelp_erp2005/helpdata/en/bb/69da54d8aedc419d46d9ea074e4d41/frameset.htm

lookup datasource in java code:

http://help.sap.com/saphelp_erp2005/helpdata/en/b5/0cb8359ae4ad4387b38d866801690f/frameset.htm

Good luck, Katharina

Former Member
0 Kudos

Looking up a datasource via Java code can be found here, not in the second link Katharina lists above:

http://help.sap.com/saphelp_erp2005/helpdata/en/82/fdbf2085f65f43a71e755fc904478d/frameset.htm

Former Member
0 Kudos

Hi,

Try

cs.setPropertyValue("driver", "oracle.jdbc.OracleDriver");

cs.setPropertyValue("url", "jdbc:oracle:thin:@host:1521:orcl","usn","pwd" );