When connecting to a Sybase SQL Anywhere server via jdbc java hangs.
License Sybase SQL Anywhere Web Edition.
Driver: The server is configured under Linux. Tell me please, maybe I need to use a different driver, or the connection string? |
Try removing the space in the connection string, and also remove "DSN=database;". Since it is a type 2 JDBC driver, it does not require a DSN. See the note at end of the "New SQL Anywhere TYPE-2 JDBC driver" topic here.
Well, the doc part seem to imply you don't need to specify a DSN - does it really mean you mustn't specify a DSN? (I always had the impression most non-ODBC-bases client interfaces can still use an ODBC DSN to collect connection parameters.)
(19 Nov '11, 08:38)
Volker Barth
Replies hidden
In the connection string I have no spaces. Simply did not fit with spaces on the page. Without the use of DSN java also hangs on connecting.
(21 Nov '11, 05:48)
xema
Replies hidden
1
Is that database already running on a database server? If so (and I would suggest that), you should specify the name of the running database (DBN=) instead of specifying the database file location (DBF=). Is there any error you are getting? - Adding the client log with LOG= may help.
(21 Nov '11, 06:21)
Volker Barth
If there is a DSN in the URL, the driver may get connection parameters from it. I thought it might be simpler to diagnose the problem if connection parameters only came from the the URL.
(21 Nov '11, 10:23)
Graham Hurst
Thanks to confirm my understanding - and I agree that for diagnosis, explicit connection params are much easier:)
(21 Nov '11, 10:35)
Volker Barth
Note also that the DBF parameter should only be used when the client, database server, and database file are all on the same computer. You mentioned that Sybase Central can connect from a Windows computer, but I assume (from your DBF path) that your Java application is running on Linux. Can Sybase Central connect when run on the same computer as your Java application? FYI, you can see the connection string for a DSN by using: ddsn -b -g <dsn_name> It might be helpful to run that on the Windows computer you used for Sybase Central, with the <dsn_name> that worked in Sybase Central. Have you tried running the Java program in a debugger, eg. to get a stack trace where you application is hanging?
(21 Nov '11, 15:33)
Graham Hurst
FWIW, the tool is called dbdsn, so the command would be
(22 Nov '11, 03:13)
Volker Barth
As I understand it, Sybase Central uses But this raises another problem: a shortage of
(22 Nov '11, 03:27)
xema
Replies hidden
In Windows, where Sybase Central
The connection string I looked in the profile of Sybase Central connection
(22 Nov '11, 03:34)
xema
Replies hidden
Yes Sybase Central and other SQL Anywhere Java administration tools use our internal JDBC-ODBC bridge driver to access ODBC datasources. I wasn't suggesting you switch to use that driver, just that you could use
(22 Nov '11, 10:38)
Graham Hurst
Yes, sorry for the typo.
(22 Nov '11, 10:39)
Graham Hurst
For those small things, sometimes it would be easier if one just could edit comments like questions and answers... Graeme, is that a feature TBD?:)
(22 Nov '11, 10:47)
Volker Barth
If it's a system DSN use
(22 Nov '11, 10:50)
Graham Hurst
You might also check for system DSNs (and possibly have to use the 32-bit or 64-bit version of dbdsn, according to the bitness of your application / Sybase Central):
(22 Nov '11, 10:53)
Volker Barth
Agreed. Comments are editable, but only for a limited time (60 minutes). However one can still delete and re-comment as a workaround. Graeme said that timeout doesn't seem to be an editable setting. :(
(22 Nov '11, 11:12)
Graham Hurst
The 60 minutes timespan is useful to edit one's own comments. (At least I'm a "heavy user" of that feature.) Nevertheless, one is not allowed to edit other's comments, even in the first 60 minutes. Now and then, I convert comments to answers temporarily to edit then and convert them back...however, this doesn't work well for such hierarchical comments as in this thread, so I would not dare to do so here...
(22 Nov '11, 11:35)
Volker Barth
|