Menu

Configuration Guide

Configuration overview

The jdbc4sapnw driver can be used like other jdbc drivers in other solutions. In the standard way a driver class will be registered and called via a jdbc URL like "jdbc:xxx://<dbhost>...".</dbhost>

The jdbc4sapnw works like a proxy and translate the jdbc commands into SAP ABAP Open SQL statements. For calling SAP ABAP systems the remote function call (RFC) will be used. The SAP Java Connector Version 3 is required and has to be available in the calling tool.

For parsing SQL statements the library ZQL is used at the moment. This library is required too.

If you want to test the driver in your environment first you can use the free version of DBVisualizer. This tool is used at reference tool for the jdbc4sapnw development and works fine.

Preparing the client

Prerequisites

Depending on the scenario you want to use the jdbc4sapnw driver you have to copy some files into the designated classpath of the using solution. If the using solution supports different file paths you can create a separate folder and put all required files into this folder (called installation folder).

jdbc4sapnw library

Download the latest version of the jdbc4sapnw driver (jdbc4sapnw*.jar) from the project files section. Put it in the installation folder.

SAPJCO3 Middleware

As a SAP customer you can download the required middleware files from the SAP Service Marketplace. Check your platform (e.g. MS Windows 32 Bit, MacOS X, Linux 64Bit) and download the right files for your plattform.

Unpack the download package and put the files into the installation folder. At least the sapjco3.jar and the platform specific library was required. In case of trouble check the support notes for "SAP JCO 3.0 Standalone" first.

SQL Parser Library - ZQL

The zql library from the ZQL Project is required. Because there are no jar file available at the ZQL project homepage you will find a current jar file at the jdbc4sapnw files section under "client-others".

Configuring the server

Installing SAP addons

There are no extensions required to use the default plugins of the driver.

If other plugins (customer extensions, other access types) should be used extensions of the SAP server could be required. Please read the description of these other plugins.

Maintaining a SAP user

For accessing the SAP system a valid user is required. This user can maintained in transaction SU01. The user type "dialog" is not required. In test systems you can set the authorization profile to "sap_all". Before you use the driver in productive scenarios you should trace all required authorizations with transaction ST01 and create a dedicated authorization profile for your scenario.

In the project files section "sap-profiles" you will find example profiles. Use transaction PFCG to upload these examples and use it for your projects.

Configuring the client

Setting the classpath

Depending on the tool you want to use the installation folder has to be found in the classpath. Some tools like DBVisualizer has a Driver Manager to configure the classpath. Configure all jar files from the installation folder,

Configure the JDBC Driver Class

JDBC drivers can be integrated by calling a Driver Class. Use the String "de.joomp.jdbc.sap.SAPJdbcDriver" as identifier.

Configure the JDBC URL

The JDBC URL template is "jdbc:jmpsap://saphost:sapport/sapclient".

If your SAP system is listening at IP 192.168.0.1 and system number 01 client 100 your JDBC URL is "jdbc:jmpsap://192.168.0.1:3201/100".

Please note:
At the moment the driver supports only "direct calls". The support for sap router strings and load balancing via sap message service is planned for later versions.
The "real" port is "32" + sap system number. In this example "32" + "01" = "3201".
You can check the port by using command line tools: e.g. "telnet 192.168.0.1 3201". The server should answer. Otherwise there can be a firewall between you and the SAP server.

Configure login data

The driver connects to an SAP system with an SAP user. This was prepared in a former step.

Example: username "JDBC_REMOTE" password "somepw".

This login information can be used in the standard jdbc connection process.

Please note:
At the moment the login method "user/password" is supported only. For later versions other logon methods are planned (e.g. certificates).

Test the Driver

If you are including the driver in a other tool use the test functionality of this tool.

Otherwise you can use this example coding to check the driver:

~~~~~~~
package default;

import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;

public class TestJdbc4Sapnw {

public static void main(String[] args) {
    // login parameters
    String JDBC_DRIVER  = "de.joomp.jdbc.sap.SAPJdbcDriver";
    String JDBC_URL     = "jdbc:jmpsap://192.168.0.1:3201/100";
    String JDBC_USER    = "jdbc_remote";
    String JDBC_PASS    = "somepw";

    // connect
    Connection conn = null;
    try {
        // Register JDBC driver
        Class.forName(JDBC_DRIVER);
        // Open a connection
        conn = DriverManager.getConnection(JDBC_URL, JDBC_USER, JDBC_PASS);
        // get database meta
        DatabaseMetaData l_meta = conn.getMetaData();
        if(l_meta != null){
            System.out.println("Driver:  " + l_meta.getDriverName() + " " + l_meta.getDriverVersion());
            System.out.println("Driver version: " + l_meta.getDriverMajorVersion() + "." + l_meta.getDriverMinorVersion());
            System.out.println("Product: " + l_meta.getDatabaseProductName() + " " + l_meta.getDatabaseProductVersion());
            System.out.println("Product version: " + l_meta.getDatabaseMajorVersion() + "." + l_meta.getDatabaseMinorVersion());                
        }
    }catch (Exception e) {
        System.err.println("Errors occured: " + e.getMessage());
    }finally{
        try {
            if(conn != null) conn.close();
        } catch (Exception e2) {
            System.err.println("Errors while closing connection: " + e2.getMessage());
        }           
    }
}

}
~~~~~

Troubleshooting

Check the WIKI pages for known issues.


Related

Wiki: Configure DBVisualizer
Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.