• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The import oracle.sql cannot be resolved

 
Ivan Turner
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm having a problem as I learn Java. I'm trying JDBC with Oracle drivers. My error is "The import oracle.sql cannot be resolved" I need the import of

I have Oracle on the laptop. I've discovered the jars are in ORACLE_HOME\jdbc\lib. How do I get the imports to see/locate the jar files in Eclipse?
 
Ivan Turner
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Project > Properties > Java Build Path is the solution. On the Library tab, use the add button and point to the files.
 
Pyla Rao
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
we need to import oracle jdbc driver api into your project libraries. its seems to solve solution.
 
Rob Spoor
Sheriff
Pie
Posts: 20661
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need to import those? JDBC works best if you only program to the interfaces in java.sql and javax.sql, keeping the database specific stuff localized to loading the class and setting up the connection String. That allows you to switch to a different database system with only little effort.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic