Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Connecting to Oracle through DirectConnect

4 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-06-16 14:20:38.0Z
Jeff Gallimore Posted on 1997-06-12 16:36:24.0Z
Message-ID: <33A02588.24C40E75@perspect.com>
Date: Thu, 12 Jun 1997 12:36:24 -0400
From: Jeff Gallimore <jgallimo@perspect.com>
Reply-To: jgallimo@perspect.com
Organization: Perspective Technology Corporation
X-Mailer: Mozilla 4.0b5 [en] (WinNT; I)
MIME-Version: 1.0
Subject: Connecting to Oracle through DirectConnect
X-Priority: 3 (Normal)
Content-Type: multipart/mixed; boundary="------------9DF5ED9C4D08F24E40FF447C"
Newsgroups: sybase.public.jdbcconnect
Lines: 93
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:696
Article PK: 252447

I am trying to get an applet to connect to an Oracle database using
jConnect (the 1.02 classes) and DirectConnect running on a Unix server.
I can get the applet to connect (at least that's what it tells me), but
when I try to execute a query using the executeQuery method, I get some
Oracle errors --

jdbc.sql.SQLException: ORA-06550: line 1, column 28:
PLS-00103: Encountered the symbol "FOR" when expecting one of the
following:
:= . ( @ % ; not null range renames default

This tells me that I have connected into the database, but the SQL
statement is malformed. Any suggestions?

Here is the code for the applet--

******************************
import jdbc.math.*;
import jdbc.sybase.utils.Debug;
import jdbc.sybase.jdbc.*;
import java.util.Properties;

public class JConnectApplet extends Applet {

public void init() {
super.init();

// Take out this line if you don't use symantec.itools.net.RelativeURL

symantec.itools.lang.Context.setDocumentBase(getDocumentBase());

//{{INIT_CONTROLS
setLayout(null);
addNotify();
resize(426,266);
//}}

try {
Class.forName("jdbc.sybase.jdbc.SybDriver");
}
catch (Exception e) {}

try {
jdbc.sybase.utils.Debug.debug(true,"ALL");
}
catch (Exception e) {}

Properties props = new Properties();
props.put("user", "tps");
props.put("password", "tps");
try {
Connection con =
DriverManager.getConnection("jdbc:sybase:Tds:galhp5:4028", props);
Statement stmt1 = con.createStatement();
int rows = stmt1.executeUpdate("INSERT INTO TEST_TAB(COL1)
VALUES ('999')");
System.out.println(String.valueOf(rows));
stmt1.close();
con.commit();
System.out.println(con.getWarnings());

PreparedStatement stmt2 = con.prepareStatement("SELECT COL1
FROM TEST_TAB");
stmt2.setCursorName("test_Cursor");

ResultSet rs = stmt2.executeQuery();
while(rs.next()) {
String id = rs.getString(1);
}

con.close();

}
catch (SQLException e) {System.out.println(e);}

}

public boolean handleEvent(Event event) {
return super.handleEvent(event);
}

//{{DECLARE_CONTROLS
//}}
}

******************************

The output is:

0
jdbc.sql.SQLWarning: Metadata accessor information was not found on this

database: Metadata accessor information was not found o
n this database
jdbc.sql.SQLException: ORA-06550: line 1, column 28:
PLS-00103: Encountered the symbol "FOR" when expecting one of the
following: := . ( @ % ; not null range renames default

*******************************

Jeff Gallimore


Download VCard vcard.vcf


Lance Andersen Posted on 1997-06-13 18:23:51.0Z
Message-ID: <33A19037.413F@sybase.com>
Date: Fri, 13 Jun 1997 14:23:51 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: jgallimo@perspect.com
Subject: Re: Connecting to Oracle through DirectConnect
References: <33A02588.24C40E75@perspect.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 101
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:690
Article PK: 252442

Jeff, one other thing, you will want to do is set the property

USE_METADATA to false.
props.put("USE_METADATA", "false");

This will prevent jconnect from trying determine the db
capabilities...

-lance

Jeff Gallimore wrote:
>
> I am trying to get an applet to connect to an Oracle database using
> jConnect (the 1.02 classes) and DirectConnect running on a Unix server.
> I can get the applet to connect (at least that's what it tells me), but
> when I try to execute a query using the executeQuery method, I get some
> Oracle errors --
>
> jdbc.sql.SQLException: ORA-06550: line 1, column 28:
> PLS-00103: Encountered the symbol "FOR" when expecting one of the
> following:
> := . ( @ % ; not null range renames default
>
> This tells me that I have connected into the database, but the SQL
> statement is malformed. Any suggestions?
>
> Here is the code for the applet--
>
> ******************************
> import jdbc.math.*;
> import jdbc.sybase.utils.Debug;
> import jdbc.sybase.jdbc.*;
> import java.util.Properties;
>
> public class JConnectApplet extends Applet {
>
> public void init() {
> super.init();
>
> // Take out this line if you don't use symantec.itools.net.RelativeURL
>
> symantec.itools.lang.Context.setDocumentBase(getDocumentBase());
>
> //{{INIT_CONTROLS
> setLayout(null);
> addNotify();
> resize(426,266);
> //}}
>
> try {
> Class.forName("jdbc.sybase.jdbc.SybDriver");
> }
> catch (Exception e) {}
>
> try {
> jdbc.sybase.utils.Debug.debug(true,"ALL");
> }
> catch (Exception e) {}
>
> Properties props = new Properties();
> props.put("user", "tps");
> props.put("password", "tps");
> try {
> Connection con =
> DriverManager.getConnection("jdbc:sybase:Tds:galhp5:4028", props);
> Statement stmt1 = con.createStatement();
> int rows = stmt1.executeUpdate("INSERT INTO TEST_TAB(COL1)
> VALUES ('999')");
> System.out.println(String.valueOf(rows));
> stmt1.close();
> con.commit();
> System.out.println(con.getWarnings());
>
> PreparedStatement stmt2 = con.prepareStatement("SELECT COL1
> FROM TEST_TAB");
> stmt2.setCursorName("test_Cursor");
>
> ResultSet rs = stmt2.executeQuery();
> while(rs.next()) {
> String id = rs.getString(1);
> }
>
> con.close();
>
> }
> catch (SQLException e) {System.out.println(e);}
>
> }
>
> public boolean handleEvent(Event event) {
> return super.handleEvent(event);
> }
>
> //{{DECLARE_CONTROLS
> //}}
> }
>
> ******************************
>
> The output is:
>
> 0
> jdbc.sql.SQLWarning: Metadata accessor information was not found on this
>
> database: Metadata accessor information was not found o
> n this database
> jdbc.sql.SQLException: ORA-06550: line 1, column 28:
> PLS-00103: Encountered the symbol "FOR" when expecting one of the
> following: := . ( @ % ; not null range renames default
>
> *******************************
>
> Jeff Gallimore
>
> ---------------------------------------------------------------
>
> Name: vcard.vcf
> Part 1.2 Type: text/x-vcard
> Encoding: 7bit
> Description: Card for Jeff Gallimore

--
===============================================================================
Lance J. Andersen Email: lancea@sybase.com
Sybase Technical Support Phone:(617) 564-6336
77 South Bedford Street Fax: (617) 564-6148
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================


Jeff Gallimore Posted on 1997-06-16 14:20:38.0Z
Message-ID: <33A54BB5.BCF09846@perspect.com>
Date: Mon, 16 Jun 1997 10:20:38 -0400
From: Jeff Gallimore <jgallimo@perspect.com>
Reply-To: jgallimo@perspect.com
Organization: Perspective Technology Corporation
X-Mailer: Mozilla 4.0b5 [en] (WinNT; I)
MIME-Version: 1.0
Subject: Re: Connecting to Oracle through DirectConnect
X-Priority: 3 (Normal)
References: <33A02588.24C40E75@perspect.com> <33A19037.413F@sybase.com>
Content-Type: multipart/mixed; boundary="------------DE16BD0484E90EA3C60F00FC"
Newsgroups: sybase.public.jdbcconnect
Lines: 630
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:675
Article PK: 252428

Lance--

Here are the debug messages:

*********************************
sj -make -cdb jConnectTest.cdb -g -classpath C:\Program
Files\sybase\jConnect\devclasses\;C:\VisualCafe\MyApps\jConnectTest\;C:\VisualCafe\JAVA\LIB\;C:\VisualCafe\JAVA\LIB\SYMCLASS.ZIP;C:\VisualCafe\JAVA\LIB\VECCLASS.ZIP;C:\VisualCafe\JAVA\LIB\SYMANTEC.ZIP;C:\VisualCafe\JAVA\LIB\CLASSES.ZIP

C:\VisualCafe\MyApps\jConnectTest\JConnectApplet.java
Build Successful
Sybase jConnect (TM) for JDBC (TM) 2.1 Development and Unsupported
Version
It is an unsupported product and is not intended for deployment. It
does not include free technical support. You can purchase
technical support on an annual or pay-per-issue basis. Discussion
Newsgroup is available on www.sybase.com. For additional
information on services or run-time license, please check Sybase
website or call 1-800-8-SYBASE or +1-510-922-3500 outside of
the USA and Canada.
Copyright 1997 Sybase, Inc.
All Rights Reserved
jdbc.sybase.jdbc.SybDriver(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
parsing connect url:
jdbc:sybase:Tds:galhp5:4028
(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]):
ProtocolManager.getProtocol("jdbc.sybase.tds.T
ds")
(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): ProtocolManager.getProtocol -- loading
jdbc.sy
base.tds.Tds
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): Constructor()
(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]):
ProtocolManager.registerProtocol(jdbc.sybase.t
ds.Tds)
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): Constructor()
jdbc.sybase.jdbc.SybDriver(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
remainder of url for
connect info is: galhp5:4028
jdbc.sybase.jdbc.SybConnection(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
attempting to co
nnect to: galhp5:4028
jdbc.sybase.jdbc.SybConnection(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): url:
galhp5:4028
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): serverHost: >galhp5<
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): serverPort: >4028<
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): database: >null<
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): login: host = 'galhp5', por
t = '4028'
jdbc.sybase.timedio.Dbio(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Connecting to 'galhp5:
4028', timeout = 0ms
jdbc.sybase.tds.PduManager(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
PduManager(is, facto
ry)
jdbc.sybase.tds.PduManager(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
configure(info)
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Constructor
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
setManager
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): create a tdsDIS on the pdu
jdbc.sybase.tds.LoginToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): Login

record
user: tps
password: tps
HOSTNAME: null
HOSTPROC:
APPLICATIONNAME: null
SERVICENAME: null
REMOTEPWD: null
CHARSET: iso_1
LANGUAGE: us_english
jdbc.sybase.tds.PduOutputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
flushing 512
(2,0) bytes, type = 2 status = 0
jdbc.sybase.tds.PduOutputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
flushing 93(
0,93) bytes, type = 2 status = 1
jdbc.sybase.timedio.Dbio(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): set
timeout = 0
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): nextResult()
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
readPacket: p
dutype = 15, pduStatus = 1, packetLen = 61 includes 8 byte header.
tdschannel = 0, tdspacket = 1, tdswindow = 0
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Cached
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): slurping token 173
jdbc.sybase.tds.Slurp(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): Ignoring variable-length
token (2byte) 173 length = 20
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): capability seen
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Capability: len
gth = 18 type = 1 maskLen = 7
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 0 = 2
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 1 = 6
5
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 2 = 6
5
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 3 = 2
49
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 4 = 2
55
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 5 = 2
55
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 6 = 2
2
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Capability: len
gth = 9 type = 2 maskLen = 7
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 0 = 0
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 1 = 0
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 2 = 1
4
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 3 = 1
04
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 4 = 0
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 5 = 0
jdbc.sybase.tds.CapabilityToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): mask
byte 6 = 8
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): done* seen
jdbc.sybase.tds.DoneToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): Done
packet status =
0, Tstate = 0, Count = 0
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): Done final
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): Did nextResult() _lastResul
t= 0
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): got back result-type 0
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Constructor
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
setManager
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): create a tdsDIS on the pdu
jdbc.sybase.jdbc.SybConnection(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
USE_METADATA is
false
jdbc.sybase.jdbc.SybConnection(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Connection creat
ed
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Constructor
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
setManager
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): create a tdsDIS on the pdu
jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
executeUpdate: IN
SERT INTO TEST_TAB(COL1) VALUES ('999')
jdbc.sybase.jdbc.EscapeTokenizer(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
EscapeTokenize
r constructor called on text 'INSERT INTO TEST_TAB(COL1) VALUES ('999')'

(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): processEscapes( INSERT INTO
TEST_TAB(COL1) VAL
UES ('999') )
jdbc.sybase.jdbc.EscapeTokenizer(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): next
called wi
th _text = 'INSERT INTO TEST_TAB(COL1) VALUES ('999')', _nextIndex = 0
jdbc.sybase.jdbc.EscapeTokenizer(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): next
called wi
th _text = 'INSERT INTO TEST_TAB(COL1) VALUES ('999')', _nextIndex = 41
(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): converted buffer = 'INSERT INTO
TEST_TAB(COL1)
VALUES ('999')'
jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
doCancel
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): cancel()
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): item was IDLE, no ATTN sent
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): language: executing 'INSERT
INTO TEST_TAB(COL1) VALUES ('999')'
jdbc.sybase.tds.PduOutputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
flushing 55(
0,55) bytes, type = 15 status = 1
jdbc.sybase.timedio.Dbio(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): set
timeout = 0
jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
nextResult
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): nextResult()
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
readPacket: p
dutype = 15, pduStatus = 1, packetLen = 17 includes 8 byte header.
tdschannel = 0, tdspacket = 1, tdswindow = 0
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Cached
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): done* seen
jdbc.sybase.tds.DoneToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): Done
packet status =
16, Tstate = 0, Count = 1
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): Did nextResult() _lastResul
t= 5
jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
nextResult: COUNT
= 1
jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
nextResult
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): nextResult()
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): nextResult already had the
final DONE token
jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
nextResult: DONE
1
jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): close

jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
cancel
jdbc.sybase.jdbc.SybStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
doCancel
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): cancel()
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): item was IDLE, no ATTN sent
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): clear

jdbc.sybase.jdbc.SybConnection(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
commit
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): language: executing 'commit
'
jdbc.sybase.tds.PduOutputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
flushing 20(
0,20) bytes, type = 15 status = 1
jdbc.sybase.timedio.Dbio(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): set
timeout = 0
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): nextResult()
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
readPacket: p
dutype = 15, pduStatus = 1, packetLen = 17 includes 8 byte header.
tdschannel = 0, tdspacket = 1, tdswindow = 0
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Cached
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): done* seen
jdbc.sybase.tds.DoneToken(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): Done
packet status =
16, Tstate = 0, Count = 0
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): Did nextResult() _lastResul
t= 5
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): nextResult()
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): nextResult already had the
final DONE token
null
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Constructor
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
setManager
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): create a tdsDIS on the pdu
jdbc.sybase.jdbc.SybPreparedStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Construct
or(conn,'SELECT COL1 FROM TEST_TAB')
jdbc.sybase.jdbc.EscapeTokenizer(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
EscapeTokenize
r constructor called on text 'SELECT COL1 FROM TEST_TAB'
(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): processEscapes( SELECT COL1 FROM TEST_TAB

)
jdbc.sybase.jdbc.EscapeTokenizer(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): next
called wi
th _text = 'SELECT COL1 FROM TEST_TAB', _nextIndex = 0
jdbc.sybase.jdbc.EscapeTokenizer(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): next
called wi
th _text = 'SELECT COL1 FROM TEST_TAB', _nextIndex = 25
(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): converted buffer = 'SELECT COL1 FROM
TEST_TAB'
jdbc.sybase.jdbc.SybPreparedStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
setCursor
Name = test_Cursor
jdbc.sybase.jdbc.SybPreparedStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
executeQu
ery SELECT COL1 FROM TEST_TAB
jdbc.sybase.jdbc.SybPreparedStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
doCancel
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): cancel()
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): item was IDLE, no ATTN sent
jdbc.sybase.jdbc.SybPreparedStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
processCu
rsor
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): language: executing 'DECLAR
E test_Cursor CURSOR FOR SELECT COL1 FROM TEST_TAB'
jdbc.sybase.jdbc.ParamManager(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
checkParams()
jdbc.sybase.jdbc.ParamManager(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
hasInParams - fal
se 0
jdbc.sybase.jdbc.ParamManager(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
hasInParams - fal
se 0
jdbc.sybase.tds.PduOutputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
flushing 70(
0,70) bytes, type = 15 status = 1
jdbc.sybase.timedio.Dbio(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): set
timeout = 0
jdbc.sybase.jdbc.SybPreparedStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
nextResul
t
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): nextResult()
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
readPacket: p
dutype = 15, pduStatus = 1, packetLen = 199 includes 8 byte header.
tdschannel = 0, tdspacket = 1, tdswindow = 0
jdbc.sybase.tds.PduInputFormatter(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]):
Cached
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): eed seen
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): processing eed
jdbc.sybase.tds.Tds(Thread[thread applet-JConnectApplet.class,6,group
applet-JConnectApplet.class]): processing EED :msgNumber :
6550
state : 1
class : 16
sqlState : null
status : 0
tranState : 0
msg : ORA-06550: line 1, column 28:
PLS-00103: Encountered the symbol "FOR" when expecting one of the
following:
:= . ( @ % ; not null range renames default
serverName : ORACLEDC
procName : null
lineNum : 0
jdbc.sybase.jdbc.SybPreparedStatement(Thread[thread
applet-JConnectApplet.class,6,group applet-JConnectApplet.class]): SQL
Error
: null
jdbc.sql.SQLException: ORA-06550: line 1, column 28:
PLS-00103: Encountered the symbol "FOR" when expecting one of the
following:
:= . ( @ % ; not null range renames default

*********************************

The INSERT statement was fine, but the SELECT bombed -- it does have a
problem creating the cursor. Now what?

Jeff

Lance Andersen wrote:

> Jeff, one other thing, you will want to do is set the property
>
> USE_METADATA to false.
> props.put("USE_METADATA", "false");
>
> This will prevent jconnect from trying determine the db
> capabilities...
>
> -lance
>
> Jeff Gallimore wrote:
> >
> > I am trying to get an applet to connect to an Oracle database using
> > jConnect (the 1.02 classes) and DirectConnect running on a Unix
> server.
> > I can get the applet to connect (at least that's what it tells me),
> but
> > when I try to execute a query using the executeQuery method, I get
> some
> > Oracle errors --
> >
> > jdbc.sql.SQLException: ORA-06550: line 1, column 28:
> > PLS-00103: Encountered the symbol "FOR" when expecting one of the
> > following:
> > := . ( @ % ; not null range renames default
> >
> > This tells me that I have connected into the database, but the SQL
> > statement is malformed. Any suggestions?
> >
> > Here is the code for the applet--
> >
> > ******************************
> > import jdbc.math.*;
> > import jdbc.sybase.utils.Debug;
> > import jdbc.sybase.jdbc.*;
> > import java.util.Properties;
> >
> > public class JConnectApplet extends Applet {
> >
> > public void init() {
> > super.init();
> >
> > // Take out this line if you don't use
> symantec.itools.net.RelativeURL
> >
> >
> symantec.itools.lang.Context.setDocumentBase(getDocumentBase());
> >
> > //{{INIT_CONTROLS
> > setLayout(null);
> > addNotify();
> > resize(426,266);
> > //}}
> >
> > try {
> > Class.forName("jdbc.sybase.jdbc.SybDriver");
> > }
> > catch (Exception e) {}
> >
> > try {
> > jdbc.sybase.utils.Debug.debug(true,"ALL");
> > }
> > catch (Exception e) {}
> >
> > Properties props = new Properties();
> > props.put("user", "tps");
> > props.put("password", "tps");
> > try {
> > Connection con =
> > DriverManager.getConnection("jdbc:sybase:Tds:galhp5:4028", props);
> > Statement stmt1 = con.createStatement();
> > int rows = stmt1.executeUpdate("INSERT INTO
> TEST_TAB(COL1)
> > VALUES ('999')");
> > System.out.println(String.valueOf(rows));
> > stmt1.close();
> > con.commit();
> > System.out.println(con.getWarnings());
> >
> > PreparedStatement stmt2 = con.prepareStatement("SELECT
> COL1
> > FROM TEST_TAB");
> > stmt2.setCursorName("test_Cursor");
> >
> > ResultSet rs = stmt2.executeQuery();
> > while(rs.next()) {
> > String id = rs.getString(1);
> > }
> >
> > con.close();
> >
> > }
> > catch (SQLException e) {System.out.println(e);}
> >
> > }
> >
> > public boolean handleEvent(Event event) {
> > return super.handleEvent(event);
> > }
> >
> > //{{DECLARE_CONTROLS
> > //}}
> > }
> >
> > ******************************
> >
> > The output is:
> >
> > 0
> > jdbc.sql.SQLWarning: Metadata accessor information was not found on
> this
> >
> > database: Metadata accessor information was not found o
> > n this database
> > jdbc.sql.SQLException: ORA-06550: line 1, column 28:
> > PLS-00103: Encountered the symbol "FOR" when expecting one of the
> > following: := . ( @ % ; not null range renames default
> >
> > *******************************
> >
> > Jeff Gallimore
> >
> > ---------------------------------------------------------------
> >
> > Name: vcard.vcf
> > Part 1.2 Type: text/x-vcard
> > Encoding: 7bit
> > Description: Card for Jeff Gallimore
>
> --
> ==
> ============================================================================
>
> Lance J. Andersen Email: lancea@sybase.com
> Sybase Technical Support Phone:(617) 564-6336
> 77 South Bedford Street Fax: (617) 564-6148
> Burlington, MA 01803
>
> The Dark Knight Returns!!! Let's Go Penguins!!!
> ============================================================
> ==================


Download VCard vcard.vcf


Lance Andersen Posted on 1997-06-13 12:22:08.0Z
Message-ID: <33A13B70.71CC@sybase.com>
Date: Fri, 13 Jun 1997 08:22:08 -0400
From: Lance Andersen <lancea@sybase.com>
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: jgallimo@perspect.com
Subject: Re: Connecting to Oracle through DirectConnect
References: <33A02588.24C40E75@perspect.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 102
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:693
Article PK: 252445

I suspect the problem is with creating the cursor.

If you could enable the debugging and recompile using
$JDBC_HOME/devclasses
this will give us some more info...

To enable the debugging.. add:

Debug.debug(true, "ALL");


to your program.

thanks

-lance

Jeff Gallimore wrote:
>
> I am trying to get an applet to connect to an Oracle database using
> jConnect (the 1.02 classes) and DirectConnect running on a Unix server.
> I can get the applet to connect (at least that's what it tells me), but
> when I try to execute a query using the executeQuery method, I get some
> Oracle errors --
>
> jdbc.sql.SQLException: ORA-06550: line 1, column 28:
> PLS-00103: Encountered the symbol "FOR" when expecting one of the
> following:
> := . ( @ % ; not null range renames default
>
> This tells me that I have connected into the database, but the SQL
> statement is malformed. Any suggestions?
>
> Here is the code for the applet--
>
> ******************************
> import jdbc.math.*;
> import jdbc.sybase.utils.Debug;
> import jdbc.sybase.jdbc.*;
> import java.util.Properties;
>
> public class JConnectApplet extends Applet {
>
> public void init() {
> super.init();
>
> // Take out this line if you don't use symantec.itools.net.RelativeURL
>
> symantec.itools.lang.Context.setDocumentBase(getDocumentBase());
>
> //{{INIT_CONTROLS
> setLayout(null);
> addNotify();
> resize(426,266);
> //}}
>
> try {
> Class.forName("jdbc.sybase.jdbc.SybDriver");
> }
> catch (Exception e) {}
>
> try {
> jdbc.sybase.utils.Debug.debug(true,"ALL");
> }
> catch (Exception e) {}
>
> Properties props = new Properties();
> props.put("user", "tps");
> props.put("password", "tps");
> try {
> Connection con =
> DriverManager.getConnection("jdbc:sybase:Tds:galhp5:4028", props);
> Statement stmt1 = con.createStatement();
> int rows = stmt1.executeUpdate("INSERT INTO TEST_TAB(COL1)
> VALUES ('999')");
> System.out.println(String.valueOf(rows));
> stmt1.close();
> con.commit();
> System.out.println(con.getWarnings());
>
> PreparedStatement stmt2 = con.prepareStatement("SELECT COL1
> FROM TEST_TAB");
> stmt2.setCursorName("test_Cursor");
>
> ResultSet rs = stmt2.executeQuery();
> while(rs.next()) {
> String id = rs.getString(1);
> }
>
> con.close();
>
> }
> catch (SQLException e) {System.out.println(e);}
>
> }
>
> public boolean handleEvent(Event event) {
> return super.handleEvent(event);
> }
>
> //{{DECLARE_CONTROLS
> //}}
> }
>
> ******************************
>
> The output is:
>
> 0
> jdbc.sql.SQLWarning: Metadata accessor information was not found on this
>
> database: Metadata accessor information was not found o
> n this database
> jdbc.sql.SQLException: ORA-06550: line 1, column 28:
> PLS-00103: Encountered the symbol "FOR" when expecting one of the
> following: := . ( @ % ; not null range renames default
>
> *******************************
>
> Jeff Gallimore
>
> ---------------------------------------------------------------
>
> Name: vcard.vcf
> Part 1.2 Type: text/x-vcard
> Encoding: 7bit
> Description: Card for Jeff Gallimore

--
===============================================================================
Lance J. Andersen Email: lancea@sybase.com
Sybase Technical Support Phone:(617) 564-6336
77 South Bedford Street Fax: (617) 564-6148
Burlington, MA 01803

The Dark Knight Returns!!! Let's Go Penguins!!!
===============================================================================