• Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.sql.DataSource Not found  RSS feed

 
bala subramani
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
i am trying to use JNDI lookup to use the datasource created in IBM websphere 4.0
import java.io.*;
import java.sql.*;
import javax.naming.InitialContext;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.sql.DataSource;
The above packages are imported. but javax.sql.DataSource makes the problem that can not resolve symbol javax.sql.DataSource
can any one help me which modification i want do.
Thanks in Advance
 
Terri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you included the JDBC 2.0 in your websphere environment?
We had to be sure that our database using version 2.0 of the JDBC and we had to be sure that we were importing version 2.0 of the JDBC classes. The dataSource is new with version 2.0.
Other than that I just used the instructions in 4.2.4.2.1: Accessing data with the JDBC 2.0 Optional Package APIs
and got it to work.
Best of Luck !!!
 
Tony Chen
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of what database are you using? DB2 v7.2? What error messages did you get? Can you post the stack trace here?
In order to help people to understand your problem, you need to describle your environment clearly.
------------------
Tony Chen
SCJP, ICS & ICSD (WebSphere)
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Terri:
Have you included the JDBC 2.0 in your websphere environment?
We had to be sure that our database using version 2.0 of the JDBC and we had to be sure that we were importing version 2.0 of the JDBC classes. The dataSource is new with version 2.0.
Other than that I just used the instructions in 4.2.4.2.1: Accessing data with the JDBC 2.0 Optional Package APIs
and got it to work.
Best of Luck !!!

Terri's right, The Optional Package can be downloaded from http://java.sun.com/products/jdbc/download.html#spec

Terri, JavcaRanch has a Naming Policy Please read and reregister with a proper name.
Thanks,
Carl
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!