A jConnect Tutorial: An introduction to JDBC programming for SAP ASE [Part I]

    By: Paul Vero on Nov 01, 2014

    This article explains how to set your environment to build and run JDBC applications using the jConnect JDBC driver to access the SAP ASE. Additionally in this part, runs of the samples included in the jConnect distribution will be demonstrated

    Quite some time ago Sybase introduced a JDBC driver to provide the ability to connect to SAP ASE outside the means of Open Client or ODBC Drivers. I believe it was the first API driver to access SAP ASE produced solely by Sybase engineers outside the proprietary Open Client APIs of DBLIB and CTLIB (including the Embedded SQL APIs). At the time the ODBC driver was provided as an OEM driver. I don’t remember the exact date of introduction, but I got in on the support action when we had the jConnect 4.5 and 5.5 version, sometime around 1998. It was really cool as it was a Type 4 Driver, meaning it provides a direct to database JDBC driver using the vendor-specific communication protocol (TDS) to establish sessions with the SAP ASE database server. The jConnect JDBC driver converts the JDBC calls directly to the TDS necessary to accomplish the task. You can learn about JDBC on your own and learn the details about java programming. What I will emphasize here are the samples we distribute with jConnect and my own sample command line driven code I use to write test cases from support cases. I provide these to engineering to demonstrate customer issues and to assist in troubleshooting so I can get to the root cause of the situation.

    The driver does have an illustrious history and I owe my gratitude to the excellent engineering and support teams back in the day at Sybase who developed the driver and created excellent sample code to help folks like me who were getting wet behind the ears when thrust into the JDBC arena. I was from a background involving support of Open Client and ODBC drivers, as well as gateways using Open Server as their main engine. To start out fresh with a new API involved a huge challenge and I was up to the task. If not for the folks I reached out to, the learning process would’ve been extremely painful. First, when a small team of us trained in JDBC and jConnect we owe Lance Andersen a debt of gratitude. He was directly involved in the creation of the jConnect samples in the distribution, which I find invaluable to my understanding of java and JDBC in general and the use of jConnect. Lance was instrumental in preparing the Tech Support team with this crucial knowledge. After Sybase, he has been with Oracle (via Sun) for quite some time, leading in the JDBC specification. Once things got started I was constantly in need of learning JDBC and how jConnect utilized the TDS protocol and interacted with SAP ASE. I depended on the Engineers at the time and I thank the following for their understanding and patience with my quest for knowledge: David Clegg, Carl Edwards, and Josh Meckler. These guys were my lifeline and I couldn’t have supported the product without their excellent and sage advice.

    There were so many other names in the background, some I worked with and others I didn’t know: Ram Singh, the manager at the helm, John Tagney, Maria Chavez (reviewer of samples), Peter Cressman, Marcus Brakweh, Farid Nabavi, Chris Black, and Brain Mcgiverin. In tech support, in addition to Lance, I want to thank Jay Anderson who mentored me in application samples and troubleshooting techniques. I also thank Wayne Smith, who worked alongside me to struggle and learn this new API for connectivity. We certainly have tales to tell in this regard on our endeavors to support the JDBC driver. I apologize if I left any names out. In current time I have new names that I work with and they are also instrumental in my pursuit of this knowledge, but the folks mentioned were the pioneers. The project was quite an effort and these were all awesome people.

    And because of this team of wonderful folks, I am able to write this article and now is the time to get to the good stuff. In this piece I’ll cover the environment from a Windows and Linux perspective to get things working in terms of building/compiling JDBC applications with jConnect and ultimately in running them. Then by using these configurations we’ll take a cruise with the distributed jConnect samples and I’ll finish up with some snippets from some code I use, a hodge-podge of code cobbled from JDBC documentation, my compadres in support and engineering and some stuff I just plain figured out on my own. It’s amazing how long you hold onto code and how often you return to the same templates over and over again.


    Login to read the article. Not a member? Create a free account!





    Copyright © 2014 ISUG-TECH. All Rights Reserved
    All material, files, logos and trademarks within this site are copyright their respective organizations

    Terms of Service - Privacy Policy - Contact the Help Desk