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
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.
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
I am sorry but I don't have access to a copy of PowerDesigner.
Maybe someone over in this area can help you...
SAP PowerDesigner
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