Consultor Eletrônico



Kbase P99221: How to determine the version of JDBC driver being used?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   07/02/2008
Status: Unverified

GOAL:

How to determine the version of JDBC driver being used?

GOAL:

What is the latest version of the JDBC driver shipped with Progress 9.1D09

GOAL:

What is the latest version of the JDBC driver shipped with Progress OpenEdge 10

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x
All Supported Operating Systems

FIX:

The getDriverVersion() method can be used to determine the version of JDBC driver.

The Progress 9.1D09 JDBC driver version is Version 1.1010 (03.60.0010)
The OpenEdge 10.1B02 JDBC driver is Version 3.60.24.

Progress 9 example:

To run this method, perform the following:
1. Execute the $DLC/bin/sql_env file to set the necessary environment variables.

2. Copy the code below into a java file.

3. Modify the Connection conn = DriverManager.getConnection "jdbc:jdbcprogress:T:localhost:10500:sp2k","",""); statement to connect to a database.

4. Compile the code using the command "javac jdbcprogresstest.java -depricate"


import java.sql.*;
class jdbcprogresstest
{
public static void main (String args [])
throws SQLException, ClassNotFoundException
{
DriverManager.setLogStream(System.out);
Class.forName ("com.progress.sql.jdbc.JdbcProgressDriver");
Connection conn = DriverManager.getConnection ("jdbc:jdbcprogress:T:localhost:10500:sp2k","","");
DatabaseMetaData dma = conn.getMetaData ();
System.out.println("\nConnected to " + dma.getURL());
System.out.println("Driver " + dma.getDriverName());
System.out.println("Version " +dma.getDriverVersion());
System.out.println("");
if (conn.getAutoCommit())
System.out.println("Autocommit is on");
else
System.out.println("Autocommit is off");
System.out.println("");
}
}

5. Run the code using the command "java jdbcprogresstest".

OpenEdge 10 example on Windows:

1. Open a Progress proenv command prompt and execute the %DLC%/bin/sql_env file to set the necessary environment variables.

2. Add the JDK directory to the path:

PATH=%DLC%/jdk/bin;%PATH%

3. Copy the code below into a java file.

4. Modify the Connection conn = DriverManager.getConnection("jdbc:datadirect:openedge://localhost:5000;databaseName=s2k","dis",""); statement to connect to a database.

5. Compile the code using the command "javac -classpath %CLASSPATH% jdbcprogresstest.java -deprecated"


&n.bsp; import java.sql.*;
class jdbcprogresstest
{
public static void main (String args [])
throws SQLException, ClassNotFoundException
{
DriverManager.setLogStream(System.out);
Class.forName ("com.ddtek.jdbc.openedge.OpenEdgeDriver");
Connection conn = DriverManager.getConnection("jdbc:datadirect:openedge://localhost:5000;databaseName=s2k","dis","");
DatabaseMetaData dma = conn.getMetaData ();
System.out.println("\nConnected to " + dma.getURL());
System.out.println("Driver " + dma.getDriverName());
System.out.println("Version " + dma.getDriverVersion());
System.out.println("");
if (conn.getAutoCommit())
System.out.println("Autocommit is on");
else
System.out.println("Autocommit is off");
System.out.println("");
}
}

6. Run the code using the command "java -classpath %CLASSPATH% jdbcprogresstest"..