• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Please help with DataSource problem

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Problem: I try to set up JDBC driver and DataSource for oracle. After setted up I use a servlet to test the connection. But I get the following error:
"exception in initjava.sql.SQLException:No suitable driver"
Background Info:
WAS used: 4.00 Advanced Single server developer edition
ORACLE used: 8.1.6.0.0 Enterprise edition
Both WAS and ORACLE run on the same machine(WIN2000 Professional)
I can access the ORACLE using regular java application after setting classpath to "classes12.zip"
servlet Code:
...servlet intialize.....
InitialContext initialcontext = new InitialContext();
out.println("before Data Source");
DataSource datasource = (DataSource)initialcontext.lookup("jdbc/orcl");
out.print("after Datasource");
Connection connection = datasource.getConnection("system","manager");
out.print("after connection");
...end servlet.....

Result:
In the browser I can see the output of "after Datasource". Which means there are no problem in JNDI binding.
In the browser I can not see the output of "after connection". Which means the problem happened in the connection to database.
The error is:"exception in initjava.sql.SQLException:No suitable driver"
JDBC driver Setting:
Server Class Path:${WAS_ROOT}\lib\classes12.zip (I also tried ${WAS_ROOT}/lib/classes12.zip, but it not work either)
Name: OracleJdbcDriver
Description: Oracle JDBC Driver
Implementation classname: oracle.jdbc.pool.OracleConnectionPoolDataSource
Data Sources Setting:
Name: oracleORCL
JNDI Name: jdbc/orcl
Default User ID: system
Default Password: *******
J2EE Resource Provider: OracleJdbcDriver
Resource Properties Setting:
Name: URL
Type: java.lang.String
Value: jdbc.oracle.thin:@IPAddress:1521 rcl
BTW: I restart the server every time I changed the settings. I tried the JDBC driver that come with ORACLE and the newest JDBC driver download from ORACLE. Both not work.
What could be wrong???
It drive me crazy for quite some time. I appreciate your help!!!

--------------------
Disabled Smilies in this Post
[This message has been edited by Rahul Mahindrakar (edited September 25, 2001).]
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not try to replace ${WAS_ROOT} with a real value. What if it is not defined?
Jun Hong
 
Huiming Gu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I tried both real path and ${WAS_ROOT}. Both does not work for me. I tried ${WAS_ROOT} is because I see the InstantDB Driver is setted with this.
 
Jun Hong
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I think I found the problem:
jdbc.oracle.thin:@
Try to replace two .'s with :'s.
Jun Hong

[This message has been edited by Jun Hong (edited September 26, 2001).]
 
Huiming Gu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much Hong Jun.
This is exactly where the problem is. How stupid I am.
 
Jun Hong
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My pleasure.
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic