EDV Beratung Kienlein

How to work with a SAPDB Database via JDBC - Drivers
with StarOffice/OpenOffice.org(Version 1.0.2 or later)

A short introduction of how to use, a SAPDB Database using JDBC without ODBC.

Download and install SAPDB:

At http://www.sapdb.org/ you will find the database and all needed tools. I tried the new Version 7.4 at http://sapdb.org/7.4/index.html and it works really great with OpenOffice.org.

For Windows:
Follow the download-link. You need the ALL - Package and the JDBC-Driver at the bottom of the page. A very good tool is the DBM-GUI.
Only if you want use the SQL-Studio, you need the ODBC-Drivers, but with OOo(=OpenOffice.org) you need none of them really. I highly recommend to download the Documentation. If you switch SAPDB off (what I donīt think), this is a really good SQL-Documentation (I think so ;-)). Ok. Now you have a sapdb-all-....zip-file, a dbmgui74-setup.exe, a sapdbc.jar and hopefully a sapdb-htmldoc-7.4.tgz.tar . If you have no way to extract the .tar - file, you can use FILZIP.
After you have unzipped the sapdb-all-...-file to where you want, take a DOS-Window and go to that Directory. Then start SDBINST.EXE. If you have a installed ADABAS D on the same Windows-System, you first have to delete the DBCONFIG, DBROOT and DBWORK -Variables from your System. You can later take them back, so write them down.
Follow the Installation and you have a ready SAPDB. If you prever a GUI-System (what I do), so start then the dbmgui74-setup.exe. There you first have to take a name for Database, I took SAPOODB. Leave the Server-Name Field empty, if you run it on the same machine. Then you have to choose a Database Manager Operator, I took SAPOPER with Password: sapoper. This is the User who works with the DBMGUI from SAP. And then a Database System Administrator, I took SAPADMIN with Password sapadmin. This account we need further on with OOo.
Next I took default values for Parameters.
If you need Unicode, you have to change on the next step under Extendent the _UNICODE Parameter to YES
Then you have to specify the volume-sizes. I took for DATA0001 20 MB and for LOG001 5 MB. But take what you want (or need). On the side to change this, change the default from KB to MB, if you are not so familiar with the disk-sizes.
Next we choose Install instance and then INSTALL again. As Database Name to register we choose again SAPOODB. Then we can close the Database Wizard.
We are now in the SAP Database Manager and we can start a instance of every Database we created with a right mouse-click and then go online.
For our first needs (if you are no real Database-Administrator and you would only work with it), we need the Database Manager now no longer and can minimize it.

For Linux, Solaris etc.:
Read the Documentation, or write it down and give it to me or OOo to publish it.

Install the JDBC-Driver:

Next you have to install the JDBC-Driver. You have got a file named: sapdbc.jar
Copy this file in a directory you want or you can use the ../lib/ext/.. directory of your java-installation. If you do this, you do not need to set the classpath, because in this directory the java-environment looks for their classes. But you have to look for using the right java.exe on your system. On Windows sometimes their is a java.exe in your /system32 directory, rename or delete this file.

Only if you do not use the /jre/lib/ext/ directory:
OOo must know the path to find this driver. Under Tools => Options => Security you can switch the ClassPath in OOo to this file. Note that you have to take this file, not only the directory where it is.

After that we have to close OOo (also the Quickstarter in the Taskbar).

Now we start OOo again.
Via Tools ==> Data Sources you get the Menu to configure the DataSources for OpenOffice.org.
Here we choose [New Data Source]

Now take [General]
Name: JDBCSAPTest1 (=it is a free Name inside OOo)
Database type: JDBC
Data Source-URL: we leave first empty

Now choose [JDBC:]
JDBC Driverclass: com.sap.dbtech.jdbc.DriverSapDB
URL: jdbc:sapdb:SAPOODB
(if we run SAPDB on the same Machine and named the DB as I do above) Username: SAPADMIN (if you took the same for the Database System Administrator)

Password required: sapadmin (if you took the same again)
Character Set: System (you can switch them later)

Next Close the Data Source Administration with OK and take a right-mouse-click on the now viewable database in the Explorer. Choose SQL. In the field Command to execute insert: create user OOUSER password oouser (or whatever you want) DBA NOT EXCLUSIVES and choose execute. By me the string looks like:
create user OOUSER password oouser DBA NOT EXCLUSIVE
Then close the SQL-Dialog and choose with a right-mouse-click again: Administrate Data Sources:
Alter the User from SAPADMIN to OOUSER. With this User you can now work with the SAPDB.

Under [Tables] you can now create more tables, queries, etc. Save the Table under a good Name (without Blanks etc., e.g. MYTABLE1) and close the Database-Explorer. In this Menu, you come quite simply with the F4 Key.

If something here is wrong or could be made better, let me know.