This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Cant connect to an specific database with jConnect and Sybase ASA 8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Cant connect to an specific database with jConnect and Sybase ASA 8" Watch "Cant connect to an specific database with jConnect and Sybase ASA 8" New topic
Author

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

Juan Manuel Diaz
Ranch Hand

Joined: Mar 23, 2009
Posts: 53
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

Joined: Dec 20, 2006
Posts: 2491
    
    8

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


OCUP UML fundamental and ITIL foundation
youtube channel
Juan Manuel Diaz
Ranch Hand

Joined: Mar 23, 2009
Posts: 53
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

Joined: Mar 23, 2009
Posts: 53
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

Joined: Dec 20, 2006
Posts: 2491
    
    8

Nothing more than we have. What do you think???,
No, it didn't help
 
 
subject: Cant connect to an specific database with jConnect and Sybase ASA 8
 
Similar Threads
How do I retrieve an SQLWarning?
accesing a database
Help on Sybase
java.lang.UnsupportedOperationException: The user must supply a JDBC connection
Strange problem with WAS and Sybase