• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cant connect to an specific database with jConnect and Sybase ASA 8

 
Juan Manuel Diaz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working in an application writen in java, it connects to a Sybase ASA Database. That database has 3 instance, one named 'clock', another named 'sysadm' and a last one named 'clinics'.

I have a class wich has a method that provides access to the database and other methods to execute some queries, it uses jConnect 6.05 driver to connect to the database. I can connect perfectly, but i can not connect to an specific instance. At the begining i only can connect to the service named 'clock', and then i shut down that service, and i could connect to the service named 'sysadm', so i shutdown that service, but i couldnt connect to 'clinics', i dont know why... Then I reboot the database server, and i could connect directly to 'clinics'. I try to force the service name to connect to with the parameter SERVICENAME=clinics at the end of the url, but i have an error:

getConnection failed: java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).

This is the code of my class:




The Configuration xml file:


I tried with diferrents sintaxs but nothing works. I tried appending the service name at the end of the url:



or passing the service name by the connection properties in the xml file



But i still having the same problem.

Any Ideas??

Thanks in advance,

JM
 
Jan Cumps
Bartender
Posts: 2599
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Juan

I checked your URL, and it seems to be ok.
getConnection failed: java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).


Does your program give more info than just this one error line?
If yes, please post the other error info,

If not please change (for debugging use only, you can change back to the original code afterwards):

from

to


Hopefully, this will return more error info.

Regards, Jan
 
Juan Manuel Diaz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jan Cumps wrote:Hi Juan

I checked your URL, and it seems to be ok.
getConnection failed: java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).


Does your program give more info than just this one error line?
If yes, please post the other error info,

If not please change (for debugging use only, you can change back to the original code afterwards):

from

to


Hopefully, this will return more error info.

Regards, Jan


Jan,

I have been doing some test yesterday, and i realized that i can connect to the first service initialized, so, in the database server, I added dependencies to the service to force to initialize first the service named 'clinics', so i could connect to it without a reference to the service name.
It is not a good solution, but it works. I dont know why i can not chose the service wich i want to connect to. I will try with your code, maybe i can get more info about the error.

Best Regards,
JM
 
Juan Manuel Diaz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, i changed the code, trying to get more debuging info. I got this:



Nothing more than we have.

What do you think???,

Regards,

JM
 
Jan Cumps
Bartender
Posts: 2599
12
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing more than we have. What do you think???,
No, it didn't help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic