1

I have found some similar questions but with no helpful answers. I need to manipulate an MS SQL Server database named PDPJ_Student from my java application and i cannot connect to it. I get the following error:

[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'LAPTOP-TITI/Titi'. The user is not associated with a trusted SQL Server connection.

and my source looks like this:

Connection con = null;
try{
   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
  con = DriverManager.getConnection("jdbc:microsoft:sqlserver://LAPTOP-TITI;DatabaseName=PDPJ_Student", "LAPTOP-TITI/Titi", "");
  }
  catch(Exception e){
   System.out.println("Error at connection");
   e.printStackTrace();
  }

When i start MS SQL Server, at authenticatin, the SERVER NAME says: LAPTOP-TITI; and the Authentication is set to Windows Authentication. The user name field says LAPTOP-TITI/Titi but it is disabled, as well as the Password field, which is empty.

I have also tried:

con = DriverManager.getConnection("jdbc:microsoft:sqlserver://LAPTOP-TITI;DatabaseName=PDPJ_Student", integratedSecurity=true);

but still nothing ..

What am I doing wrong ? Can you give me some indications please?

p.s I am not allowed to change my Authentication type, and even if I try changing to SQL Server Authentication, it doesn`t let me create any new users

1 Answer 1

1

Your question doesn't mention whether your client machine is running Windows or non-windows. This topic on MSDN suggests that if your client is using Linux, you'll need to purchase the DataDirect driver to get Kerberos authentication working. If you're on Windows, it should be possible with Microsoft's JDBC driver.

Sign up to request clarification or add additional context in comments.

1 Comment

Its running under Windows Xp and I set into the projects classpath the msbase.jar, mssqlserver.jar and msutil.jar .... That should be enough to get java working with MS SQL Server

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.