Appendix B: jConnect Sample Programs  Running jConnect sample programs and code

Appendix B: jConnect Sample Programs

Running IsqlApp

IsqlApp allows you to issue isql commands from the command line, and run jConnect sample programs.

The syntax for IsqlApp is:

IsqlApp [-U username] [-P password]
   [-S servername]
   [-G gateway]
   [-p {http|https}]
   [-D debug-class-list]
   [-v] 
   [-I input-command-file]
   [-c command_terminator]
   [-C charset] [-L language]
   [-T sessionID]
   [-V <version {2,3,4,5}>]

Parameter

Description

-U

The login ID with which you want to connect to a server.

-P

The password for the specified login ID.

-S

The name of the server to which you want to connect.

-G

Gateway address. For the HTTP protocol, the URL is: http://host:port.

To use the HTTPS protocol that supports encryption, the URL is https://host:port/servlet_alias.

-p

Specifies whether you want to use the HTTP protocol or the HTTPS protocol that supports encryption.

-D

Turns on debugging for all classes or for just the ones you specify, separated by a comma. For example,

-D ALL

displays debugging output for all classes.

-D SybConnection, Tds

displays debugging output only for the SybConnection and Tds classes.

-v

Turns on verbose output for display or printing.

-I

Causes IsqlApp to take commands from a file instead of the keyboard.

After the parameter, you specify the name of the file to use for the IsqlApp input. The file must contain command terminators (“go” by default).

-c

Lets you specify a keyword (for example, “go”) that, when entered on a line by itself, terminates the command. This lets you enter multiline commands before using the terminator keyword. If you do not specify a command terminator, each new line terminates a command.

-C

Specifies the character set for strings passed through TDS.

If you do not specify a character set, IsqlApp uses the server’s default charset.

-L

The language in which to display error messages returned from the server and for jConnect messages.

-T

When this parameter is set, jConnect assumes that an application is trying to resume communication on an existing TDS session held open by the TDS-tunnelling gateway. jConnect skips the login negotiations and forwards all requests from the application to the specified session ID.

-V

Enables the use version-specific characteristics. See “JCONNECT_VERSION connection property”.

NoteYou must enter a space after each option flag.

To obtain a full description of the command-line options, enter:

java IsqlApp -help

The following example shows how to connect to a database on a host named “myserver” through port “3756” and run an isql script named “myscript”:

java IsqlApp -U sa -P sapassword 
   -S jdbc:sybase:Tds:myserver:3756 
   -I $JDBC_HOME/sp/myscript -c run

NoteAn applet that provides GUI access to isql commands is available as: $JDBC_HOME/sample2/gateway.html (UNIX) %JDBC_HOME%\sample2\gateway.html (Windows)





Copyright © 2003. Sybase Inc. All rights reserved. Running jConnect sample programs and code

View this book as PDF