Home > Archive > SQL Anywhere database > August 2005 > My Java application will not connect to SQL Anywhere 9 on Pocket PC









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author My Java application will not connect to SQL Anywhere 9 on Pocket PC
Tim

2005-08-23, 8:23 pm

I have created a AWT Java application that runs successfully
against SQL Anywhere 9 on Windows 2000 using the jconnect
JDBC driver, but it does not work on Pocket PC.

Note that this application has also worked with Oracle Lite
on Windows 2000 and Pocket PC with the Oracle JDBC drivers
instead.

I have done the following install routine on Pocket PC which
follows a similar path to the tried and tested Oracle Lite
scenario:

1. Installed SQL Anywhere 9 onto device in the following
directory: \Program Files\Sybase\ASA9
2. Copied the jconn2.jar file to ASA9 directory.
3. Copied my application demo.jar to ASA9 directory.
4. Installed CrEme JVM onto device.
5. Copied over a shortcut depts.lnk to ASA9 directory:
55#" \Windows\CrEme\bin\C
rEme.exe" -Of -verbose -classpath
'.;/Program Files/Sybase/ASA9;/;/Program
Files/Sybase/ASA9/jconn2.jar;/Program
Files/Sybase/ASA9/demo.jar' depts
6. Started up database by clicking on the dbsrv9 exe in the
ASA9 directory. This starts listening on port 2638 and
proven to work with the Sybase ODBC example.
7. Double clicked on depts.lnk: My application starts up and
presents the first window which is a logon window with 3
fields.
Entered User=dba, Password=sql, Connect
String=jdbc:sybase:T
ds:localhost:2638
8. Get following error:
java.sql.SQLExcpetion: JZ00L:Login failed. Examine the
SQLWarnings chained to this exception for the reasons(s).
9. Tried Jeode JVM instead of CrEme.
10. Tried depts.lnk:
55#"\Windows\evm.exe" -Djeode.evm.console.local.keep=TRUE
-cp ".;/Program Files/Sybase/ASA9;/;/Program
Files/Sybase/ASA9/jconn2.jar;/Program
Files/Sybase/ASA9/demo.jar" depts
11. Get different error on trying to connect:
java.lang.NoSuchMethodError:
java/sql/Connection. createStatement(II)L
java/sql/Statement;

I can get this application to work with Oracle Lite on
Pocket PC, but not with SQL Anywhere. What have I missed?
Shuchit

2005-08-24, 7:23 am

Tim wrote in news:430b9c55.6fe.1681692777@sybase.com:

> I have created a AWT Java application that runs successfully
> against SQL Anywhere 9 on Windows 2000 using the jconnect
> JDBC driver, but it does not work on Pocket PC.
>


Since you are using the Jconnect jdbc driver, make sure the server is
listening to tcp connections. By default it does not.

Shuchit
Tim

2005-08-27, 7:23 am

> Tim wrote in news:430b9c55.6fe.1681692777@sybase.com:
>
>
> Since you are using the Jconnect jdbc driver, make sure
> the server is listening to tcp connections. By default it
> does not.
>
> Shuchit


Thank you Shuchit.

I am running ASA9 on my iPAQ which is starting the tcp
listener by default.

Regards,

Tim.
Tim

2005-08-27, 7:23 am

> Tim wrote:
> reasons(s).
>
> Try starting the database engine with the "-z" and "-zo"
> options to log communication information to a logfile
> and then seeing the contents of that file after a failed
> login attempt. This will indicate whether the client is
> even hitting the server or not.
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/


Greg,

Thank you for your advice. I have added more parameters to
the depts.lnk to capture the networking output to a file
called dump.log as below. I have forced all host names to
127.0.0.1. I have modified the Java app to connect using:
User=3ddba, Password=3dsql, Connect
String=3djdbc:sybase
:Tds:127.0.0.1:2638

I. 08/27 11:28:11. 1: -n
I. 08/27 11:28:11. 2: 127.0.0.1
I. 08/27 11:28:11. 3: -x
I. 08/27 11:28:11. 4: tcpip{host=3d127.0.0.1;port=3d2638}
I. 08/27 11:28:11. 5: -z
I. 08/27 11:28:11. 6: -o
I. 08/27 11:28:11. 7: dump.log
I. 08/27 11:28:11. 8: \Program Files\Sybase\ASA9\as
ademo.db
I. 08/27 11:28:11.
I. 08/27 11:28:11. Adaptive Server Anywhere Network Server
Version 9.0.2.2451
I. 08/27 11:28:11.
I. 08/27 11:28:11. Copyright =a9 1989-2004 Sybase, Inc.
I. 08/27 11:28:11. Portions Copyright =a9 2002-2004,
iAnywhere Solutions, Inc.
I. 08/27 11:28:11. All rights reserved. All unpublished
rights reserved.
I. 08/27 11:28:11.
I. 08/27 11:28:11. This software contains confidential and
trade secret information of
I. 08/27 11:28:11. iAnywhere Solutions, Inc.
I. 08/27 11:28:11. Use, duplication or disclosure of the
software and documentation
I. 08/27 11:28:11. by the U.S. Government is subject to
restrictions set forth in a license
I. 08/27 11:28:11. agreement between the Government and
iAnywhere Solutions, Inc. or
I. 08/27 11:28:11. other written agreement specifying the
Government's rights to use the
I. 08/27 11:28:11. software and any applicable FAR
provisions, for example, FAR 52.227-19.
I. 08/27 11:28:11.
I. 08/27 11:28:11. iAnywhere Solutions, Inc., One Sybase
Drive, Dublin, CA 94568, USA
I. 08/27 11:28:12.
I. 08/27 11:28:12. Networked Seat (per-seat) model. Access
to the server is limited to 2 seat(s).
I. 08/27 11:28:12. This server is licensed to:
I. 08/27 11:28:12. Developer Edition
I. 08/27 11:28:12. Restricted Use
I. 08/27 11:28:12. Running on Windows CE 3.0 Build 11171
I. 08/27 11:28:12. 1332K of memory used for caching
I. 08/27 11:28:12. Using a maximum page size of 1024 bytes
I. 08/27 11:28:12. Starting database "asademo" (\Program
Files\Sybase\ASA9\as
ademo.db) at Sat Aug 27 2005 11:28
I. 08/27 11:28:15. Transaction log: asademo.log
I. 08/27 11:28:15. Starting checkpoint of "asademo"
(asademo.db) at Sat Aug 27 2005 11:28
I. 08/27 11:28:15. Finished checkpoint of "asademo"
(asademo.db) at Sat Aug 27 2005 11:28
I. 08/27 11:28:15. Database "asademo" (asademo.db) started
at Sat Aug 27 2005 11:28
I. 08/27 11:28:15. Database server started at Sat Aug 27
2005 11:28
I. 08/27 11:28:16. Trying to start SharedMemory link ...
I. 08/27 11:28:16. SharedMemory link started
successfully
I. 08/27 11:28:16. Trying to start TCPIP link ...
I. 08/27 11:28:16. Loading ws2_32.dll
I. 08/27 11:28:16. TCP using Winsock version 2.0
I. 08/27 11:28:16. Starting TCP listener on IP address
0.0.0.0:2638
I. 08/27 11:28:16. Starting on port 2638
I. 08/27 11:28:16. Starting UDP listener on IP address
127.0.0.1:2638
I. 08/27 11:28:16. This is a class A network address
I. 08/27 11:28:16. Looking for server with name 127.0.0.1
I. 08/27 11:28:16. Sending broadcast to find server
I. 08/27 11:28:16. Using broadcast address of:
127.255.255.255:2638
I. 08/27 11:28:21. Server not found (no reply received)
I. 08/27 11:28:21. TCPIP link started successfully
I. 08/27 11:28:21. Now accepting requests
I. 08/27 11:29:01. TCP/IP: Received connection request from
127.0.0.1:1156.
I. 08/27 11:29:01. Connection from 127.0.0.1:1156 assigned
connection ID 1
I. 08/27 11:29:02. TDS 1: connection created
I. 08/27 11:29:02. TDS 1: login
I. 08/27 11:29:02. TDS 1: using TDS version 5.0.0.0
I. 08/27 11:29:02. TDS 1: capability
I. 08/27 11:29:02. TDS 1: login: user 'dba', database '',
application '', host '', host_pid '', charset ''
I. 08/27 11:29:04. Connection ID 1: "dba" connected to
database "asademo" over TCPIP
I. 08/27 11:29:04. Connection ID 1: Server character
translation is enabled, but not required
I. 08/27 11:29:04. using character set "cp1252"
I. 08/27 11:29:04. TDS 1: request complete
I. 08/27 11:29:08. Connection ID 1: connection "DBA"
terminated abnormally
I. 08/27 11:29:08. Connection ID 1: "DBA" disconnected from
database "asademo"
I. 08/27 11:29:08. Connection ID 1: Client disconnected

I notice that the TCP listener is listening on 0.0.0.0:2638
even though I thought I had forced it with the =93=96x
tcip=94 parameter.

Do you have any further suggestions?
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com