File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes javax.sql package error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "javax.sql package error" Watch "javax.sql package error" New topic
Author

javax.sql package error

Yell Srik
Ranch Hand

Joined: Mar 10, 2004
Posts: 61
Hi,
I have jdk1.3 installed on my machine.

When i executed a JDBC program on my machine, the errors i got were:
(1) "import java.sql.*" cannot be resolved
(2) "import javax.sql.DataSource" cannot be resolved.
On googling, i found the reason for this and then i downloaded the JDBC 2.0 Optional Package for jdk1.3 from Sun's website and installed it on my machine in the folder path: C:\jdk1.3\jre\lib\ext
and also added it to my classpath variable.

But when i run my JDBC program, it is still giving me the error
"import javax.sql.DataSource" cannot be resolved.

how can this be resolved?

Thanks in advance.
Janhavi Namshikar
Ranch Hand

Joined: Sep 29, 2005
Posts: 85

Check if you have the j2ee.jar in the classpath.

Janhavi.


"Weekends don't count unless you spend them doing something completely pointless."
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29219
    
134

While you are checking the classpath, make sure you have your JDBC driver included at runtime.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
I think you should scrap the classpath environment variable altogether and set the classpath as needed at run and compile times. How you managed to get a java.sql not found compile time error is a bit mysterious but it takes some doing to do that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax.sql package error
 
Similar Threads
Pls find the error
Cofiguring JDBC
How to know the version of JDBC
package oracle.sql
JSP page not displayed - javax.servlet.jsp.PageContext could not be resolved