Consultor Eletrônico



Kbase P110482: How to run a java code against a Progress database using v9.x JDBC driver
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/14/2008
Status: Unverified

GOAL:

How to run a java code against a Progress database using v9.x JDBC driver

GOAL:

Sample Java code to test the Progress JDBC driver

GOAL:

Sample Java code to help with troubleshooting JDBC driver problems

FIX:

1) PROSERVE your database with -S and -H parameters
2) Start Notepad and copy and paste the Java code from the Note below into it
3) Save the file to DLC\JDK\Bin\, naming it JDBCtest.java, and configure the following variables:

* jdbcdriver
* jdbcurl
* username
* password
* sql

The following example shows a sample configuration connecting to a Sports2000 database that has been started with -S 9999 and -H localhost:

username = "pub";
password = "pub";
sql = "select * from pub.customer";
jdbcdriver = "com.progress.sql.jdbc.JdbcProgressDriver";
jdbcurl = "jdbc:jdbcprogress:T:localhost:9999:sports2000";

Note: The values of ClassName (jdbcdriver) and URL (jdbcurl) reflect the Progress 9.x JDBC driver. Refer to solution P117496 for the OpenEdge 10.x values.

4) Start PROENV
5) CD to DLC\Bin and run SQL_ENV.BAT to set Progress Java environment (sets the CLASSPATH variable)
6) CD to DLC\JDK\Bin and run:

javac JDBCtest.java

7) Execute the new .class file with the command:

java JDBCtest

The result of the SQL query should be displayed.