pro2jdbc - Progress to JDBC interface

Usage

  1. Start JDBC server
    1. Open pro2jdbc.properties using any text editor and type proper values, especially into url, user and password.

    2. Compile and run Pro2JdbcServer.java

      Remember that your CLASSPATH should contain jdbc driver for PostgreSQL and dot (.) indicating current directory. Property file pro2jdbc.properties is located in current directory and Java search for property files in CLASSPATH.

      • Under Windows:

        Prepare file go.bat cointaining something like that:

        go.bat
        set CLASSPATH=.;c:/program files/PostgreSQL/8.0/jdbc/postgresql-8.0-311.jdbc3.jar
        if exist %1.class del %1.class
        javac -encoding windows-1250 %1.java
        if exist %1.class java -Dfile.encoding=windows-1250 %1
        

        Put your encoding instead of windows-1250 and point .jar file with JDBC driver.

        Compile and start:

        C:\Java> go Pro2JdbcServer

      • Under Unix/Linux:

        Prepare file go cointaining something like that:

        go
        if [ -f $1.class ]; then rm $1.class ; fi
        javac $1.java
        if [ -f $1.class ]; then java -cp .:postgresql.jar $1 ; fi
        

        Compile and start:

        # go Pro2JdbcServer

      Server should start and display:
      Channel is open...


  2. Progress 4GL
  3. List of files:

    pro2jdbc.p usage:

    Important notice: After executing jdbcExecuteQuery() you have to retrieve all records using jdbcGetRecord() - otherwise they would be waiting in TCP/IP buffer so subsequent calls might be scrambled.

    Each record is returned as a single string containing tab separated list of field values. If a field is null then it is returned as question mark (?).

    In case of an error returned string begins with "SQL_EXCEPTION " followed by error message.

    Only 'select' are supported at the moment, however handling 'insert', 'update' and 'delete' will not be a problem.