Well I changed the code because I am trying to test the connection but orinally I will connect through
JSp.
this is the code:
import java.sql.*;
public class TestarConnect{
Connection conn;
public static void main(String [] args) throws ClassNotFoundException {
String uname = "Username";
String pwd = "password";
String url = "jdbc:microsoft:sqlserver://server:1433";
try {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
DriverManager.getConnection(url,uname,pwd);
System.out.println("Connection Successfull");
}
catch(SQLException e){
System.err.println(e.getMessage());
System.out.println("VendorError: " + e.getErrorCode());
System.out.println("Connection failed");
}
}
}
And I am getting this error now:
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'eloi.teixeira'.
I am using MS SQL Server 2000 with windows 2000 and I alredy ask the dba to change to mixe mode authentication but nothing Can anyone see what is wrong with this code.
I am using eclipse and I am new with it but I added the msssqlserver.jar in the classpath of the eclipse and in the window like:
c:\Arquivos de Programas\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;C:\Arquivos de Programas\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;C:\Arquivos de Programas\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar;
Thank you