This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "javax.sql package error" Watch "javax.sql package error" New topic

javax.sql package error

Yell Srik
Ranch Hand

Joined: Mar 10, 2004
Posts: 61
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.


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

Joined: May 26, 2003
Posts: 33134

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

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, 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:
subject: javax.sql package error
It's not a secret anymore!