This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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

JDBC and Pointbase

 
Rajeev Asthana
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently installed J2EE 1.4 and this has Pointbase 4.6.
I can see that it has three jars (for Drievr, I guess):
pbclient.jar
pbembedded.jar
pbtools.jar
Now I wrote a dumbest Java program to access one of it's table called EMP.
I can see that the URL of the database is:
jdbc :pointbase ev (as displayed as node in PointBase Console) and it's on port 9092.
Please see the program below:

I'm getting various errors. First of all, it's not recognizing Driver and then it's saying that database DEV doesn't exist.
Please tell me what Settings do I need to make in CLASSPATH, javac, java etc.
And how to successfully run it...
Thanks in advance..
Rajeev.
[ May 10, 2004: Message edited by: Jeanne Boyarsky ]
 
Rajeev Asthana
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it converting colon into faces?

(edited to remove cursing)
[ May 10, 2004: Message edited by: Jeanne Boyarsky ]
 
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
Rajeev,
You need to check the disable smilies checkbox at the bottom of the posting page. (I edited it for you to do that.) In the future, you can always go back and edit your own post to do the same thing if you realize it afterwards.
 
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
Rajeev,
Now on to your question:
The first thing you need to do is put all that code in one large try/catch block instead of a bunch of little ones. Otherwise, you run into a problem when an early thing fails. For example, if it can't find the driver, you don't want it trying to connect.
You need to double check that the driver is in your classpath. Are you using an IDE? Sometimes these things need to be set up in multiple places.
 
Rajeev Asthana
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
Rajeev,
Now on to your question:
The first thing you need to do is put all that code in one large try/catch block instead of a bunch of little ones. Otherwise, you run into a problem when an early thing fails. For example, if it can't find the driver, you don't want it trying to connect.
You need to double check that the driver is in your classpath. Are you using an IDE? Sometimes these things need to be set up in multiple places.

Thanks for the advise, I did following:
1. Changed the code to put a single try block.
2. Added pmembedded.jar in CLASSPATH. There are 2 more jars - pmclient.jar and pmtools.jar
3. Compiled source
4. When I tried to run it, it gave error that "No suitable driver".
What should I do now...
Thanks..
BTW, the code is
 
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
Rajeev,
Sun has this error listed in their FAQ. It is probably a problem with your URL string.
 
Rajeev Asthana
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
Rajeev,
Sun has this error listed in their FAQ. It is probably a problem with your URL string.

It worked after I used pbembedded.jar instead of pbclient.jar.
I don't know why (may be the actual driver is inside this pbembedded.jar).
But is there a way to check whether a driver is in a particular jar?
 
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
Rajeev,
A jar file is the same format as a zip file. So you can unjar/unzip it and look to see if the class is in the file. If you have Winzip, the preview mode lets you see an alphabetical list of all the files without having to unzip it.
 
Rajeev Asthana
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
Rajeev,
A jar file is the same format as a zip file. So you can unjar/unzip it and look to see if the class is in the file. If you have Winzip, the preview mode lets you see an alphabetical list of all the files without having to unzip it.


Thanks Jeanne....I saw what you are saying..

I have a related question. Are URLs different for a standalone Java program and a Java program that is deployed in Application Server? How to find what URL to use? Also, can the same driver be used for different URLs?
[ May 13, 2004: Message edited by: Rajeev Asthana ]
 
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
Rajeev,
No the URLs are not different. Some drivers have specific urls. For example, Oracle has a piece of the URL that specifies if you are using a thin driver.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic