Skip to Content
avatar image
Former Member

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

Hi,

I am trying to connect to a Sybase Database using java, using the jConn3 library. It exists on the class path.

Sample Code:

sybDriver = (SybDriver) Class.forName( "com.sybase.jdbc3.jdbc.SybDriver").newInstance(); con = DriverManager .getConnection("jdbc:sybase:Tds:<IP>:<PORT>?serviceName=C1603", "USER", "PWD");

Statement stmt = con.createStatement();

// Execute the query ResultSet rs = stmt.executeQuery("select * from dba.attempt where disposition=1100");

However, I end up receiving an error -

Exception in thread "main" java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s). at com.sybase.jdbc3.jdbc.ErrorMessage.raiseError(Unknown Source) at com.sybase.jdbc3.tds.Tds.for(Unknown Source) at com.sybase.jdbc3.tds.Tds.case(Unknown Source) at com.sybase.jdbc3.tds.Tds.login(Unknown Source) at com.sybase.jdbc3.jdbc.SybConnection.a(Unknown Source) at com.sybase.jdbc3.jdbc.SybConnection.handleHAFailover(Unknown Source) at com.sybase.jdbc3.jdbc.SybConnection.<init>(Unknown Source) at com.sybase.jdbc3.jdbc.SybConnection.<init>(Unknown Source) at com.sybase.jdbc3.jdbc.SybDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at example.SybaseConnectivity.makeConnection(SybaseConnectivity.java:24) at example.SybaseConnectivity.main(SybaseConnectivity.java:50)

Is there a way to fix this?

Sybase Version being used : 11.0.1.2627.

The problem occurs when we are trying to obtain data out of Sybase using Java (jconn3 library which is in the classpath). The sybase data is embedded with a third party software called Wincati from Sawtooth Technologies.

How do we apply the EBF to the sybase version so to find the SQL warnings in the console of an IDE like eclipse?

Thanks & Regards,

-Rajarshi

Add comment
10|10000 characters needed characters exceeded

  • Hi Rajarshi,


    Which SQL Anywhere version do you use?
    When you use version 11, we fix the following problem.

    -------------------------------------------------------------------------------
    If an application was using one of the JDBC based Remote Data Access classes
    (i.e. either SAJDBC or ASEJDBC), and the remote login failed, then there
    was a possibility that the error reported would not contain the actual reason
    for the failed login. When jConnect throws a JZ00L SQLException, the actual
    reason for the failed login is usually contained in a chained SQLException,
    rather than the main SQLException. The server will now report the error on
    the chained exception instead of reporting the topmost SQLException.
    -------------------------------------------------------------------------------

    We fix this problem EBF2139 and later.
    You apply latest EBF and should confirm the actual reason for the failed login.

    Thanks,
    Atsushi

  • If the database is part of that software package you mentioned, I'd encourage you to contact the vendor before making changes like installing an EBF. You might run into issues, if that EBF isn't fully supported.

    Just my 2 cents ...

  • Get RSS Feed

2 Answers

  • Mar 29, 2017 at 05:22 PM

    The warnings are chained to the object that threw the exception and accessed with the getWarning() method. My guess however is that the connection was not successfully established and has returned a NULL. Can you check that to be the case and, if so, are you sure that the credentials, IP,port and database name are correct?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Chris,

      Thanks for your response!

      About the error, I will explain in more details if it helps. The sybase database is wrapped around a third party software called Wincati developed by Sawtooth technologies( http://www.sawtooth.com/ ). This software has has a number of software/studies loaded and is primarily used in Survey Labs to interview and gather data.

      Each study/survey has a backend Sybase Database attached to it.

      The credentials, IP, port and database name are correct in the above example. C1603 is a sample study which has a sybase DB attached to it.

      Also, I think i got past the connection issue, but with a different error this time.

      When the sample code from above is run I get the below error -

      Exception in thread "main" com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -141: Table 'attempt' not found at com.sybase.jdbc3.tds.Tds.a(Unknown Source) at com.sybase.jdbc3.tds.Tds.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.executeQuery(Unknown Source) at com.sybase.jdbc3.jdbc.SybStatement.executeQuery(Unknown Source) at example.SybaseConnectivity.makeConnection(SybaseConnectivity.java:30) at example.SybaseConnectivity.main(SybaseConnectivity.java:50)

      Now, I know for a fact that the table does exist.

      Furthermore, when the study (C1603) is open inside Wincati Software, the code runs just fine with the correct results. However, if the study is not open inside Wincati Software, the above exception is thrown.

      Do you see any reason regarding this weird connection behavior? Please let me know, if you need further information.

      Warm Regards,

      -Rajarshi.

  • Mar 31, 2017 at 10:56 AM

    I think that you will be able to find the cause of the error with -z and -o options.

    -z server option is displays diagnostic communication messages, and other messages, for troubleshooting purposes.
    http://dcx.sap.com/index.html#1101/en/dbadmin_en11/z-database-dbengine.html

    -o server option is prints all database server messages to the database server message log file. http://dcx.sap.com/index.html#1101/en/dbadmin_en11/o-database-dbengine.html

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Volker,

      I am sure, something similar has been going on since the query which gets executed in DBISQL returns a
      "table not found" error in Java unless the DBISQL has a connection open to the particular database.

      However, we have been using a previous version of the third party software (version 4) for many years successfully and we are planning to upgrade the software (version 6). The credentials for reading data from the tables has not changed with the version.

      Do you suspect any feature might have changed in between the two versions which is causing the connection failure?

      (I am simply trying to narrow down the problem as in if the issue lies with the vendor software or java )

      Warm Regards,

      -Rajarshi.