connecting to an iAnywhere db

Can anyone tell me how I can connect to an iAnywhere database. It looks like I can’t use the (standard) ASA jdbc driver…

Hello,

When I started fooling with some of the iAnywhere databases (the standard, Sybase supplied templates) I had to run a script to allow the JDBC driver to be utilized. Once you run the script the database should work. also - are you sure the databases you desire are actually running? Just because the little icon shows the engine is running it doesn’t mean that your specific tables are being served. If you look at the Sybase DOCs you should be able to find the instructions.

Sorry I can’t direct you exactly but I’m on the road.

Thanks, I will check this out!

This comes right out of the Sybase online docs. Their on-line tool is really nice because it allows one to save “Favorites”. Then you can go back & re-read the subject matter without having to remember search key words, etc. Sybase’s documentation is excellent.

(Snip)

Adaptive Server Anywhere Programming Guide
4. Using Java in the Database Introduction

Setting up the Java samples


Many of the examples in this chapter require you to use a set of classes and tables added to the sample database. The tables hold the same information as tables of the same name in the sample database, but the user ID named jdba owns them. They use Java class data types instead of simple relational types to hold the information. You can find the sample in the Samples\ASA\Java subdirectory of your SQL Anywhere directory.

Sample tables designed for tutorial use only. The sample tables illustrate different Java features. They are not a recommendation for how to redesign your database. You should consider your own situation in evaluating where to incorporate Java data types and other features.

Setting up the Java examples involves two steps:

Java-enable the sample database.

Add the Java sample classes and tables.

To Java-enable the sample database:
Start Interactive SQL and connect to the sample database.

In the SQL Statements pane of Interactive SQL, type the following statement:

ALTER DATABASE UPGRADE JAVA JDK '1.3’Shut down Interactive SQL and the sample database.

The asademo.db database must be shut down before you can use Java features.

To add Java classes and tables to the sample database:
Start Interactive SQL and connect to the sample database.

In the SQL Statements pane of Interactive SQL, type the following statement:

READ "path\Samples\ASA\Java\jdemo.sql"where path is your SQL Anywhere directory. This runs the instructions in the jdemo.sql command file. The instructions may take some time to complete.

You can view the script Samples\ASA\Java\jdemo.sql using a text editor. It executes the following steps:

Installs the JDBCExamples class.

Creates a user ID named JDBA with password SQL and DBA authority, and sets the current user to be JDBA.

Installs a JAR file named asademo.jar. This file contains the class definitions used in the tables.

Creates the following tables under the JDBA user ID:

product

contact

customer

employee

sales_order

sales_order_items

This is a subset of the tables in the sample database.

Adds the data from the standard tables of the same names into the Java tables. This step uses INSERT from SELECT statements. This step may take some time.

Creates some indexes and foreign keys to add integrity constraints to the schema.


(End Snip)