HowTo: Java


Prerequisites


All the files required to run the examples are contained in the directory $DEP/doc/FirstSteps/Java.


Accessing SQL using JDBC

Hello, SAP DB
HelloSAPDB.java shows
  • how to connect to the database
  • how to execute SQL
  • how to fetch results
  • execute it as
    java HelloSAPDB <sqluser> <password> <dbname> <host>
    The command line arguments are optional, the defaults will access the installed demo database


Accessing the DB Manager using the DBM class

Database state
StateSAPDB.java shows
  • how to connect to the Database Manager
  • how to execute simple commands using the dbmcli syntax
  • how to parse results
  • execute it as
    java StateSAPDB <dbmuser> <password> <dbname> <host>
    The command line arguments are optional, the defaults will access the installed demo database