File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC & Eclipse

 
Joe Shy
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I believe this is common problem that has been answered, but I was unable to find anything real clear in the forums. I have been using TextPad to do all my coding and thought I would try eclipse. However, when I run the exact same app that works just fine through the command line with Eclipse I get the following error:

Being new to eclipse, I am assuming I have to add the JDBC connection information to the project, but have no idea what I am doing wrong. I did the project->properties->libraries->add class folder, which i select the said oracle folder for
DriverManager.registerDriver(new oracle.rdb.jdbc.rdbThin.Driver());

folder stucture is like so:

oracle\rdb\jdbc - rdbThin (Driver() is in here)
- common
- util

Any Ideas?

Thanks,

Joe
[ December 19, 2005: Message edited by: Joe Schider ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe,
Did you add a specific jar to the classpath or just the Oracle folder? You need to tell Eclipse about a specific jar.
 
Joe Shy
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have to use a jar or can you add folders also? After playing with it a bit, I was able to get it to work with a jar, but the jar is just the folder structure compressed. If there is a way to add folders containing the needed classes I would like to know.

Thanks for the help,

Joe
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you add folders, you'd need to add the directory that contains the top-level "oracle" directory, not the oracle directory itself.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17625
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You add directories using the "Add Class Folder" button on the project build libraries page.

However, it looks like you're attempting to work with an exploded copy of the oracle driver jar. Why not just include ojdb14.jar or classes12.jar as library jars for the project?
 
Joe Shy
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Well I don't have to add the folders, and I know the benefits of jar, but I was just trying to see if the situation required that I could just add the class folders and jar the whole project and then just update the main-class in the manifest. This would give me a self contained executable that I could send to my non-tech internal customers. If you have a better way, possibly a a jar of jars, I would like to hear about it.

Thanks again,

Joe
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the "jar in a jar" solution take a look at http://one-jar.sourceforge.net/

But be careful - as far as I know, redistributing the oracle jar file actually is illegal - and repackaging it probably doubly so.
 
Joe Shy
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link. Very interesting. As far as illegal activity, when I say
send to my non-tech internal customers
, I was just 'trying' to say co-workers (all of whom have oracle on their PC's) in a fancy way. So, I hope that doesn't call for more Sheriff activity.



Joe
[ December 22, 2005: Message edited by: Joe Schider ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic