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.
Request clarification before answering.
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 |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.