• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javax.sql package error

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

Janhavi.
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While you are checking the classpath, make sure you have your JDBC driver included at runtime.
 
Ranch Hand
Posts: 381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic