Skip to Content
Author's profile photo Former Member

Setting up a PowerBuilder JDBC connection to SAP HANA

Here’s what you need to do to connect to a HANA database from PowerBuilder via JDBC.

A word about my setup.  I was using Windows 7 Home Premium 64 bit.  PowerBuilder 12.5.1 Classic.

First, download the SAP HANA Client from the SAP HANA Development Center.  Make sure you choose the 32 bit driver version.

(You will also need the SAP HANA Studio as well to set up the user id / password but that’s for another time).

Next, in PowerBuilder go to Tools – System Options and select the Java tab.  Add to the Classpath setting the following:

C:\Program Files (x86)\SAP\hdbclient\ngdbc.jar

/wp-content/uploads/2012/11/pbclasspathsetup_160259.png

You should change the path to match the installation location for your particular situation.

Assuming you already have HANA set up somewhere (using Amazon Web Services (AWS) is a good place) along with a user id and password, connect your transaction object with the following code.

SQLCA.DBMS = “JDBC”

SQLCA.LogPass = <password> // password in quotes

SQLCA.LogId = <userid> // user id in quotes

SQLCA.AutoCommit = False

SQLCA.DBParm = “Driver=’com.sap.db.jdbc.Driver’,URL=’jdbc:sap://ec2-55-222-56-111.compute-1.amazonaws.com:30015? reconnect=true’,PBCatalogOwner=’SYSTEM’,OJSyntax=’ANSI'”

Pay attention to the URL.  The example here uses HANA running on AWS.

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo S. Marie
      S. Marie

      Hi Matt.

      Would you have the same kind of walkthrough for PowerDesigner ?

      I cannot find the Tools/System Equivalent, and my attempts at creating any Data Connection profile just failed...

      Thanks for your help

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      I am sorry but I don't have access to a copy of PowerDesigner.

      Author's profile photo Former Member
      Former Member

      Maybe someone over in this area can help you...

      SAP PowerDesigner

      Author's profile photo S. Marie
      S. Marie

      Thanks for the advice.

      I posted a question regarding my own trouble there : Creating a jdbc connection to HANA with Powerdesigner 16.5 SP04 (64bits)

      ... Any good idea 's more than welcome.

      Regards,

      Stephane