[See all pages on this site.] [Find out more about Trifox Inc.] [Find out how to contact Trifox personnel.] [Complete product documentation, FAQs, online references.] [Pricing is simple.] [Download an evaluation copy of any Trifox product.] [Descriptions of all products, including VORTEX, DesignVision, and Genesis.]

[LOGO]
[Navigation Map]

 

[Search Site]

| 

VORTEX Java and JDBC Connectivity

I am working with Intel and my operating system is Solaris 2.5.1. Is there pure java VORTEX for my platform?
Yes -- VORTEXJava(tm) Edition. See the VORTEXjava product page for details.

I reviewed all your java documentation about commit() and rollback(), but I haven't found a parameter to specify if the transaction should be read only.
You don't need to specify the transaction as read-only. If startUpdateTrans is false, the transaction is read-only.

I keep getting an error, TRACE FILE OPEN ERROR, when I try to connect to Software AG's ADABAS D using VORTEXjava. What's up?
Usually TRACE FILE OPEN ERROR means the ADABAS D call interface can't write a trace file. It's written if the environment vairable SQLOPT is set to -X. Is this set on your system? Often this error is only a question of permissions in the current directory.

I seem to be missing the API_users_guide.html file from the Java HTML directory.
You need to get that from www.javasoft.com

What's the difference between VORTEXjdbc and VORTEXJava? They seem to be the same thing. Also, why is VORTEXserver required?
VORTEXJava(tm) Edition (its most correct name) is a pure Java implementation and requires the user to code specifically to our Java interface. VORTEXjdbc follows the JDBC API specification.

Both VORTEXJava and VORTEXjdbc use a socket interface to access the VORTEXserver which is our database access layer in VORTEXserver. Since they are running via sockets, they require our VORTEXserver.

I can't seem to connect from my NT machine with CLASSPATH including c:\vortex\sql. I downloaded all the files from your ftp directory. Have I missed something??
Assume that you restored the tar file's contents into c:\java. You will then have a c:\java\vortex directory. Set your CLASSPATH to include c:\java. javac looks for the dbChannel class in $CLASSPATH\vortex.

I can't start the sample file in the eval. I get the error java.lang.NoClassDefFoundError: vortex/dbChannel.
The CLASSPATH environment variable must include the directory in which you installed the evaluation kit. That is how Java finds the vortex/dbChannel class. See previous question.

When I tried to run sample5, I got the following error: SQL0805N Package "DB2ADM1.TDB7BND" was not found. SQLSTATE=51002. Is this a DB2 error or am I missing something from your package?
The db2 driver you are using requires a package called tdb7.bnd to be bound to your DBMS. Use the following commands to bind to your DBMS:
   
sqlbind tdb7.bnd <dbname> -f=ISO.

How do I run the Vortex Java Edition without installing the Vortex classes on the client site? Can I put them all on the server side and expect the Vortex classes to be loaded over the net?
If you are running an applet, then the Vortex Java Edition classes must be installed on the server where the applet loads. Otherwise they must be on the client system.

Why do I get a security violation error when I try to run VORTEXJava with the applet on our web server. I am able to run all the sample programs succusfully with the classes in an Applet and the code on my own machine. We have a distributed (Sun) network. I have the server set up in my account which I run on the machine I am logged on.
When opening a socket on Java running as an applet the Browser only allows you to connect to the machine where the Java code was loaded from. This means that you either need to have your database on the same machine as your web server, or you can (in your connect string) start a VTX3 process which would in turn connect to a database on another machine. Take a look at VORTEX scenario 1 on our web site.

Why can't I submit SELECT commands with the VORTEXjdbc? They always result in a Java exception. The INSERT command works fine. Any ideas?!
Are you using JDK1.1? Make sure that you are using the VORTEXjdbc for version 1.1, not the 1.0 release.

How do I configure the connection between an Oracle server on one machine and vtxnetd on a different machine? What paramters must be set? Does it run as a specific user or can the server run as any user ? What dbConnect parameters are set for your sample programs?
You must specify the correct SQL*NET parameters so that the VORTEXserver can access the Oracle system on the other machine. For example, if you are using SQL*NET v1, you would use
     scott/tiger@T:<hostmachine>:<sid>

If you are using SQL*NET v2, then you would use
     scott/tiger@dbname

The host name refers to the vtxnetd machine.

What SQL*NET connect string in the JDBC URL connects VORTEXserver on one machine to Oracle on another machine? Host name/address: bigo
Port: 7777
Host program: /eng/work/vortex/server/VTX0
Env Variables:
ORACLE_HOME=/export/usr8/oracle/product/7.1.3,ORACLE_SID=work
DB connect string: dbo/manager@work
Yes, except you need to add @work to the JDBC portion. In order for the @7777 to get picked up before the @work you need 2 @s i.e.:

     jdbc:vortex://dbo/manager@@work@7777....

As you can see you can add all the SQL*NET syntax before, in your case, @7777. Just remember the '@' and ':' must be doubled up so they don't get confused with the rest of the VORTEX connect syntax.

Another way of getting to the other machine is to have vtxnetd start up VTX3 (VORTEXnet) instead of VTX0 (Oracle driver). You would need vtxnetd/VTX) on the other machine as well. This is a good way of handling the browser/applet security restriction that says that the applet can only open a socket to the server where the applet originated from.

It is also a handy way of allowing DB access through a packet filtering firewall. You simply install vtxnetd on the firewall.

Can you give me more information on your JDBC and CTree application? We have a CTree database and are looking for a Java/JDBC application to implement the same.
C-tree access is accomplished via the VORTEXserver and GENESIS. GENESIS is an ANSI-2 SQL parser which converts that SQL statements into data manipulation calls for the underlying flat-file DBMS. In this case, it will call the WORM c-tree driver.

Our Java/JDBC client products write directly to the socket and communicate with the VORTEXserver which then calls GENESIS.

Our driver relies upon a dictionary that we build and maintain in c-tree. This dictionary will not pick up existing c-tree definitions unless you have a dictionary already. In this case, you will have to write a dictionary loader. New c-tree files created via SQL will have their definitions in the dictionary.

A dictionary file is very different from a parameter file. The dictionary keeps track of the table/field/index definitions so that the GENESIS SQL engine can determine how to manage queries.

Does the Trifox product come with a classes.zip file? I ask because when I try to compile sample1, I get the following C:\trifox\sample>javac sample5.java sample5.java:7: Package vortex not found in import. import vortex.*;
You need to ensure that you have a vortex directory under your CLASSPATH directory with the contents of the kit.

When I tried to run the JDBC via Netscape I got an error. I did the database access, but it doesn't work via Netscape from a remote Client. The main problem is, that I get the following message on the Netscape CLIENT's Java Console (3.0):
AppAccelerator(tm) 1.0.2 for Java, x86 version.
Copyright...
VERIFIER ERROR vortex/sql/vortexDriver.<init>()V:
Cannot find class java/sql/driver
This situation does not ocur in Java 1.1. In JDBC1.0.2, JDBC is not part of the Java Virtual Machine, and thus, for security, Netscape will not load the Java classes from the host. You must have the Java classes, in this case VORTEX, on the machine which is running Netscape.

I can hack into my host via VORTEX network manager because it launches any executable specified in the URL. How do I deal with security?
You can set up a file on the server machine that specifies which executables are allowed to be launched by vtxnetd. On the vtxnetd command line, there is a "-f" option that identifies a file with the valid services, one per line. The service to be started must match one of these lines identically.

Why can't I get an entire result set returned as a single object? Data could be retrieved in a single exchange with the server, and at a transfer rate comparable to a large http "get" operation.
VORTEXjdbc bulk fetches data based on a fetch buffer size. The default is a 8k buffer, i.e. for a 100 byte record up to 80 records at a time is moved over the network.

Bulk INSERT/UPDATE/DELETEs are also supported in order to minimize the number of roundtrips needed. For example you can insert multiple records into a Java cursor(record) object and then blast all the records across the network in one operation.

Does VORTEXjdbc performs its caching on the client side or server side? Is it any more than a JDBC type-3 driver from the client's perspective, or does it have a higher-level API?
Cacheing is done on the client side.

VORTEXjdbc is not a proxy. It commicates directly to VORTEXserver in a message based protocol. This protocol has been in production since the late 80s. VORTEXserver also supports several other client languages, such as Perl, C/C++, etc.

In addition, VORTEXjdbc communicates with VORTEXserver, which can start up another VORTEXclient that would allow you to "hop" through a firewall or reach a machine that the client might not be directly connected to.

It also can take advantage of VORTEXaccelerator, which allows you to multiplex the client connections.

What is the syntax of calling stored procedures through Java? According to the metadata it says Vortex supports storedProcedures.
At this point, VORTEXjdbc does not support stored procedures. When you check allProceduresAreCallable() DbMetaData, it returns "VORTEXjdbc does not support stored procedures."

Does VORTEX support a JDBC type 3 driver?
Yes, VORTEXjdbc is a type 3 driver.

I'm trying to make a JDBC driver for an Informix 7 (Standard Engine) database. I'm using the makesrv.inf7 file as you recommend, but I don't have the file tdb5_7.o required in this file nor much of the system libraries under the variable DLIBSAIX7, which are also required during the make process.
Do you have Informix ESQL installed? If not, then we will have to send you a linked excutable.

Why do I get an exception when I try to update a date field with using stmt.setTimestamp( xxx ) where xxx is a java.sql.Timestamp object? SQLException :
SQLState[ null ]
Message[ Update exception: E_US10CE '1997-07-03 14:09:39.194' is
not a valid date. (Thu Jul 3 12:09:14 1997) ]
Vendor[ 0 ]
We use the Oracle datetime format internally to pass datetime information to and from the server. Since there is no room for milliseconds, we convert timestamps to strings. This works for some DBMSs - Ingres is not one of them.

Can I access a database on a server other than the one from which the applet is downloaded ?
If you connect to VTX3.so (on unix) or vtx3.dll (on NT) you can connect to a 3rd machine. We have an illustration of just such a scenario.

We are getting the following error message: java.lang.IllegalAccessError: Unimplemented interface method at Simplevtex.main(Simplevtex.java:58)
You must be certain to use the correct version of VORTEXjdbc. If you are running JDBC 1.02, use vtxjava.tar.Z; otherwise you must use vtxjava1.1.tar.Z. This error typically shows up when you mix up the versions.

When is the net.ini file used?
net.ini is not used for JDBC. The JDBC client software uses our lowest level interface to VORTEXnet and net.ini is used by our higher level tools.

Can we program an applet which is located at a server, is downloaded in the browser and then uses your JDBC to connect to ADABAS C? If yes, do we have to use a web server, or is it possible to put the applets on the Vortex Server? We want an administration free client. So our scenario (at the moment) is:
ADABAS-C (MVS) <--$gt; ADABAS SQL Server (MVS) <--$gt; Trifox Channel/Server <--$gt;
and now we want an Java applet which can be downloaded at client site via the standard browser.
If you want to download applets to a client machine with zero-administration then you must use a browser that supports JVM 1.1. The only browsers that currently support this are HotJava, Netscape Communicator version 4 and Internet Explorer version 4.

Your applets must be located on your web server.

Why do I get the error "ld.so.1: /opt/vtxnet/VTX0: fatal: libclntsh.so.1.0: can't open file: errno=2" when I try to connect from the client?
You need to make sure that LD_LIBRARY_PATH for the server process is set to the Oracle path where the .so files are located. You can either do this from the process that starts vtxnetd:
     setenv LD_LIBRARY_PATH /oradir/bin
Or in the connect string from the client:
     ....,ORACLE_HOME=....,LI_LIBRARY_PATH=/oradir/bin1

I see in the samples bind ("IN parameters") are denoted by things like ":1". I only see "$" in the JDBC spec. Am I missing something? Is the sample correct or are you non-conformant?
The sample is correct, it is the Oracle method since they allow users to repeat bind variables simply by repeating the parameter marker number. You can also use '?'.

Will you give me some examples of connect strings please?
Sure, since you ask so nicely. Have you looked in the .html documentation in the VORTEXjdbc tar package? There are examples there, too.
     machine    host (server) machine name
     port       port on which server listens
                VORTEXserver default is 1958
     driver     VORTEXserver driver type
     DBMS       database name 
The correct VORTEXserver process must be in the PATH or you must provide a fully-qualified path as a third parameter to the connect.

Informix 7.2/NT

     url="jdbc:vortex//demo/demo/stores7@1958:nthost!C:\VTX\BIN\VTX5";

     url="jdbc:vortex//myinfdb@1958:myinfsvr!VTX7"

     where myinfsvr  server machine name
           myinfdb   database name

Sybase SQL Server 11/Unix

    url="jdbc:vortex//uid/pwd/pubs2/SYBASE@19333:myhost!
              /home/user/vortex/bin/VTX2";

     where pubs2     database name
           SYBASE    server name

HTTPd/Solaris --> ODBC/Solaris

     url="jdbc:vortex//uid/pw/datasource@1958:myhost!/usr/vtx/VTX11";
        
     where myhost                     machine running ODBC
           1958                       VORTEXserver port
           /usr/vtx/bin/VTX11         Trifox ODBC driver
           "uid/pw/datasource"        ODBC datasource

HTTPd/NT --> ODBC/NT

     url="jdbc:vortex//uid/pw/datasource@1958:myhost!C:\VTX\BIN\VTX11";
        
     where myhost                     machine running ODBC
           1958                       VORTEXserver port
           /usr/vtx/bin/VTX11         Trifox ODBC driver
           "uid/pw/datasource"        ODBC datasource

MS Access/NT

     url="jdbc:vortex:///<msaccessdb>@<host>!vtx11";

Oracle/Unix

     url="jdbc:vortex//scott/tiger@1958:myhost!/usr/vtx/VTX0";

Oracle/NT

     url="jdbc:vortex//scott/tiger@1958:myhost!C:\VTX\BIN\VTX0";

How about some connect string samples for Java?
Let's dive right in:
Informix 7.2/NT
     db.connect("nthost",1958,"C:\VTX\BIN\VTX5", "demo/demo/storesr5"," ");

     where nthost                machine running NT 
           1958                  TCP/IP number  on which VORTEXserver listens
	   "C:\VTX\BIN\VTX5"     Trifox Informix driver
           "demo/demo/stores5"   uid, pwd, and database name 
To run with Informix 7.1, rename VTX5_71.DLL to VTX5.DLL.

HTTPd/Solaris --> ODBC/Solaris

     db.connect("myhost", 1958, "/usr/vtx/VTX11","uid/pw/datasource",
                      " ");
        
     where myhost                     machine running ODBC
           1958                       VORTEXserver port
           /usr/vtx/bin/VTX11         Trifox ODBC driver
           "uid/pw/datasource"        ODBC datasource

HTTPd/NT --> ODBC/NT

     db.connect("myhost",1958, "C:\VTX/BIN\VTX11","uid/pw/datasource"," ");
DB/Unix
     db.connect("localhost",1958,"/usr/vtx/bin/VTX7",
                   "sample",
                   "DB2_HOME=/usr4/db2/sqllib,DB2INSTANCE=db2");

     where localhost                  machine running DB2
           1958                       VORTEXserver port
           /usr/vtx/bin/VTX7   Trifox ODBC driver

How do I retrieve and format Oracle number columns using VORTEXJava in the right format? e.g., fees number(15, 2) Since this is for read only purposes, a String is fine.
dbNumber.toString() converts it to a string. Also System.out.print[ln] automatically calls toString() of any object it is printing.

© 1985-2020 Updated 26 Sep 2005.