This section describes how to run the server-side connection
example.
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 C:\Documents
and Settings\All Users\SybaseIQ\samples\SQLAnywhere\JDBC directory under
your Sybase IQ installation directory from a command prompt:
javac JDBCExamples.java
Start a database server using the demo database. You
can start such a server on your local machine using the following
command (from the IQ-15_4/java subdirectory):
On UNIX: start_iq .../iqdemo
On Windows: start_iq ...\iqdemo
The TCP/IP network protocol is not necessary in this
case, since you are not using jConnect. However, you must have at
least 8MB of cache available to use Java classes in the database.
Install the class into the demo database. Once connected
to the demo database, you can do this from Interactive SQLusing
the following command:
INSTALL JAVA NEW
FROM FILE 'C:\Documents and Settings\All Users\SybaseIQ\samples\SQLAnywhere\JDBC\JDBCExamples.class'
where path is the path to your installation
directory.
You can also install the class using Sybase Central. While
connected to the demo 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.