Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDBC Connection to Progress91b

Status
Not open for further replies.

siren

Programmer
Aug 7, 2002
5
TR
By using JDBC driver, I am trying to connect to a Progress91b db through a class and a servlet. The commands that the class and servlet are using while connecting to the db are the same:

...

String driver = "com.progress.sql.jdbc.JdbcProgressDriver";
String URL = "jdbc:jdbcprogress:T:localhost:10500:rac";
String username = "dba1";
String password = "dba1";

Connection con = null;
DatabaseMetaData dmd = null;
ResultSet rs = null;

try
{
Class.forName( driver );
con = DriverManager.getConnection( URL, username, password );

.....



I can easily connect to the db and see the results of a query through a class. However, I cannot do the same things by a servlet and I come across such an error:
"java.lang.ClassNotFoundException: com.progress.sql.jdbc.JdbcProgressDriver"

In short, when I try to connect to the db by a servlet it cannot find the JDBC driver. What shall I do?
 
I think your problem is that when you use an IDE like JBuilder, you tell the IDE where the jdbc classes are, and it automatically puts the location of the jdbc driver in the CLASSPATH env var on compilation/interpretation, but your servlet does not have this. Try the following fixes :

(From easiest/cleanest first)
1. Enter the path of the jdbc driver in your env var (ie in autoexec.bat if on a dos/windows system)
2. Or enter the path on command line like "java WhateverClass - classpath C:\jdbcdriverfolder"
3. dump the jdbc driver .jar file in the same directory as the servlet.class 's folder
4. do number 3, then go to that directory, and uncompress the jar file (I think its "jar -xmf jdbcdriver.jar")

Number 4 should definitely work ...

Hope has been some help,

Ben
 
I am using Windows 2000 so I set the env variables from MyComputer/Properties/Advanced tab as shown below:


CLASSPATH = D:\PROGRESS91B\java\jdbc.zip;D:\PROGRESS91B\java\progress.zip;D:\PROGRESS91B\java

PATH = D:\PROGRESS91B\BIN;D:\PROGRESS91B\jdk\BIN;D:\PROGRESS91B\jre\BIN

JAVAHOME = D:\PROGRESS91B\java

JDKHOME = D:\PROGRESS91B\jdk

JREHOME = D:\PROGRESS91B\jre

DLC = D:\PROGRESS91B


These env variables are set as recommended in the Progress ProKB (Knowledge Base). D:\PROGRESS91B is the directory where Progress91b is installed.

D:\PROGRESS91B\java\jdbc.zip is the place where the JDBC driver is located. There are many classes like JdbcProgressDriver.class in the jdbc.zip file. Note that there are no .jar files for Progress.

I also dumped the jdbc.zip file to the directory where my servlet.class is but it still could not find the JDBC driver and gave the same error: “java.lang.ClassNotFoundException: com.progress.sql.jdbc.JdbcProgressDriver”



What shall I do, now?

Thanks,

Meltem

P.S. Yes, I am using JBuilder 6 Enterprise Edition.



 
Damn! OK ....

Just to check :

Have you tried registering/telling good 'ol JBuilder where the dirver classes are (Under one of the main menus there is an option called "Configure jdk" - [I think]) ?

I know its a bit of a hassle, but its not a long term solution ... Have you tried unzipping/uncompressing the entire jdbc file and sub-dir's D:\PROGRESS91B\java\jdbc.zip inside the directory where the servlet.class lives (and any dir's where there a re classes which your application lives), and then compiling any .java files that are there (they should all be .class files, so probably arn't). This will then tell you whether it REALLY cant find the driver classes, or whether this message is infact a rogue sympton of some other problem that's hiding ....

If this doesn't work, then I am fast running out of ideas !!! I have got a friend who uses progress a lot at his work ... I'll give him a shout if the above still brings no joy !

Ben
 
Here is what I did in JBuilder:

1) From Tools/Configure Libraries I added a new folder (I gave it the name "JdbcProgress") under "User Home" and in the "class" tab I added the classes below (Probably only the first or the third one is sufficient but I added all the .zip's I could find under D:\PROGRESS91B\java folder):

[D:\PROGRESS91B\java\jdbc.zip]\com\progress\sql\jdbc
[D:\PROGRESS91B\java\progress.zip]\com\progress\sql\jdbc
D:\PROGRESS91B\java\jdbc.zip
D:\PROGRESS91B\java\progress.zip
D:\PROGRESS91B\java\progress2.zip
D:\PROGRESS91B\java\proxygen.zip
D:\PROGRESS91B\java\aia.zip
D:\PROGRESS91B\java\o4glrt.jar
D:\PROGRESS91B\java\o4glrt.zip
D:\PROGRESS91B\java\o4glrt2.zip

2) From Tools/Configure JDK there is nothing I can do.
3) Yes, I unzipped the jdbc.zip and progress.zip files in the folder where my servlet.class is (I did this before your last reply). There are no .java files in these .zip's, they are all .class files.

4) From Tools/Database Pilot, I am trying to make a new db connection but I cannot see the Progress JDBC driver in the drop-down menu probably because it is not properly registered. However, when I write "com.progress.sql.jdbc.JdbcProgressDriver" manually it connects to db perfectly. Actually, my servlet is independent from connecting to db by Database Pilot. I am using DB Pilot just for testing and it is connecting to my db.

I don't know what to do next.

In Progress Knowledge Base (KB#21333), I read that Progress91b supports JDK1.1.8 but JBuilder 6 has JDK 1.3.1. Can this situation cause a problem?

Thank you,
Meltem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top