JDBC setup trouble.

ron

Member
AIX server + 10.2B.

I have a test (sports) DB on the server and have successfully compiled and run this small test Java program against it:

Code:
[B]import java.*;[/B]
[B]import java.sql.*;[/B]
 
[B]public class test {[/B]
[B]  public static void main (String args[])[/B]
[B]      throws SQLException, ClassNotFoundException {[/B]
[B]    int i = 5;[/B]
[B]    Class.forName ("com.ddtek.jdbc.openedge.OpenEdgeDriver");[/B]
[B]    Connection conn = DriverManager.getConnection[/B]
[B]        ("jdbc:datadirect:openedge://localhost:8888;" +[/B]
[B]         "databaseName=sports;user=sysprogress;password=sysprogress");[/B]
[B]    Statement stmt = conn.createStatement();[/B]
[B]    ResultSet rset = stmt.executeQuery("select name from PUB.customer");[/B]
[B]    while ( rset.next() && i>1 ) {[/B]
[B]      System.out.println(rset.getString(1));[/B]
[B]      i--;[/B]
[B]    }[/B]
[B]  }[/B]
[B]}[/B]

My problem is that I need to be able to access the DB from my PC - which has Windows 7 - and NO Progress installation at all.

I have copied the Java program into my PC home directory - and changed "localhost" to be the server IP address. I also copied (binary) openedge.jar and pool.jar from the server into my PC home directory.

I have installed JDK (jdk1.6.0_31) and JRE (jre6) onto the PC - and set the ENV variable to include the JDK and JRE bin directories.

I have created a new ENV variable CLASSPATH and set it to the full pathnames of the two .jar files.

I can compile the test program - but when I try to execute it I get a ClassNotFound exception on OpenEdgeDriver.

Can anyone please help me out of this problem?

Cheers,
Ron.
 

RealHeavyDude

Well-Known Member
I don't have OE 10.2B but I successfully used JDBC many times. The documentation contains a book "OpenEdge Data Management: SQL Development" that describes what it takes. There it states that the driver consist out of these files on Windows:


  • %DLC%\java\openedge.jar
  • %DLC%\java\util.jar
  • %DLC%\java\base.jar
  • %DLC%\java\pool.jar
  • %DLC%\java\spy.jar

Heavy Regards, RealHeavyDude.
 

ron

Member
Yes - I have checked the documentation.

Two problems, however ...

1. As of 10.2B only openedge.jar and pool.jar are now required.
2. I can't use %DLC% - because the PC doesn't have Progress installed.

I can install a Progress client on my PC, of course, but for the users who will actually be using this - they will not have Progress.

I guess that begs the question ... can Java be used with JDBC if the Progress client is not installed? I can't understand why that would be so, however.

Ron.
 

RealHeavyDude

Well-Known Member
At that point I must admit that I never used the Progress JDBC drivers on a machine that did not have any Progress installation. But Progress does provide a product called SQL client access which is - as far as I know - free of charge so that you can just download it from the ESD as you have purchased some other products from them.

You can access the Electronic Software Distribution site here:

http://www.progress.com/progress/esd/myproducts.jsp


Heavy Regards, RealHeavyDude.
 

Marian EDU

Member
I have copied the Java program into my PC home directory - and changed "localhost" to be the server IP address. I also copied (binary) openedge.jar and pool.jar from the server into my PC home directory.

I have installed JDK (jdk1.6.0_31) and JRE (jre6) onto the PC - and set the ENV variable to include the JDK and JRE bin directories.

I have created a new ENV variable CLASSPATH and set it to the full pathnames of the two .jar files.

I can compile the test program - but when I try to execute it I get a ClassNotFound exception on OpenEdgeDriver.

Ron.

You got the right driver class and required jar's (openedge.jar will be enough), you don't need to have Progress installed having that openedge.jar file should be all that it takes... what you have is a classpath issue, there is no error at compile time since all you use is plain JDBC interface and load the driver at runtime.

How do you start the test program? Can you try to add the jar to classpath in command line as in
Code:
java -classpath openedge.jar test
 
Top