on 12-07-2005 1:12 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Hi,
Try
cs.setPropertyValue("driver", "oracle.jdbc.OracleDriver");
cs.setPropertyValue("url", "jdbc:oracle:thin:@host:1521:orcl","usn","pwd" );
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.