This section describes how to run the server-side connection example.
Creating and executing the internal connection example application
If you have not already done so, compile the JDBCExamples.java file. If you are using the JDK, you can do the following in the /asa/java directory from a command prompt:
javac JDBCExamples.java
Start a database server using the sample database. You can start such a server on your local machine using the following command (from the /asa/java subdirectory):
On UNIX: start_asiq .../asiqdemo
On Windows: start_asiq ...\asiqdemo
The TCP/IP network protocol is not necessary in this case, since you are not using jConnect. However, you must have at least 8 Mb of cache available to use Java classes in the database.
Install the class into the sample database. Once connected to the sample database, you can do this from Interactive SQL using the following command:
INSTALL JAVA NEW FROM FILE 'path\\asa\java\JDBCExamples.class'
where path is the path to your installation directory.
You can also install the class using Sybase Central. While connected to the sample database, open the Java Objects folder and double-click Add Class. Then follow the instructions in the wizard.
You can now call the InternalConnect method of this class just as you would a stored procedure:
CALL JDBCExamples>>InternalConnect()
The first time a Java class is called in a session, the internal Java virtual machine must be loaded. This can take a few seconds.
Confirm that the message Hello World
prints
on the server screen.