The code fragments in the following sections are taken from the complete class in %SQLANYSAMP16%\SQLAnywhere\JDBC\JDBCExample.java. In preparation for these sections, the sample Java application is compiled and installed into the database.
A Java Development Kit (JDK) must be installed.
To install a class, you must have the MANAGE ANY EXTERNAL OBJECT system privilege.
Compile the JDBCExample.java source code.
Connect to the database from Interactive SQL.
Install the JDBCExample.class file into the sample database by executing the following statement in Interactive SQL:
INSTALL JAVA NEW FROM FILE 'JDBCExample.class';
If the database server was not started from the same directory as the class file and the path to the class file is not listed in the database server's CLASSPATH, then you will have to include the path to the class file in the INSTALL statement.
You can also install the class using Sybase Central. While connected to the sample database, open the Java subfolder under External Environments and click File » New » Java Class. Follow the instructions in the wizard.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0|