Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.sql package error

 
Yell Srik
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if you have the j2ee.jar in the classpath.

Janhavi.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While you are checking the classpath, make sure you have your JDBC driver included at runtime.
 
Maximilian Xavier Stocker
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic