java.sql.SQLException: JZ00L: Login failed. when connecting with Sybase
843854Dec 24 2004 — edited Nov 20 2006Hi all,
I am trying to connect the sybase database from java application.
After setting my classpath D:\SybaseDriver\jConnect-5_5\classes\jconn2.jar;.;
It loads the driver. But unable to connect. I am getting error:
java.sql.SQLException: JZ00L: Login failed. Examine the SQLWarnings chained to this exception for the reason(s).
My Code snippet is:
import java.sql.*;
import com.sybase.jdbcx.*;
public class SybaseConnectivity
{
Connection con=null;
Statement stmt=null;
SybDriver sybDriver = null;
public void makeConnection() throws Exception
{
//try
{
sybDriver = (SybDriver) Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();
System.out.println("Driver loaded");
con = DriverManager.getConnection("jdbc:sybase:Tds:192.168.0.67:5000","sa","");
}//catch(Exception e)
{
//System.out.println("Error is "+e.getMessage());
}
}
public static void main(String args[]) throws Exception
{
SybaseConnectivity sc=new SybaseConnectivity();
sc.makeConnection();
}
}
Where (192.168.0.67) is the IP and 5000 is the port no. of a different machine having the database configured.
I have set the classpath then why this error.
Any help is highly appreciable.
Regards,
Har Krishan.