Skip to main content



      Home
Home » Newcomers » Newcomers » Java mewbe/student - ms sql connectionstring login failed for user(Trouble connecting to ms sql database remotly )
Java mewbe/student - ms sql connectionstring login failed for user [message #1717945] Thu, 17 December 2015 23:22 Go to next message
Eclipse UserFriend
I'm trying to make a program to connect to a remote ms sql database to test and learn how to using the following code.

// Create a variable for the connection string.
String connectionUrl = "jdbc:sqlserver://my.server.com;Initial" +
"Catalog=test2;Persist Security Info=True;User ID=rsmobile;Password=xxxx";

// Declare the JDBC objects.
Connection con = null;
Statement stmt = null;
ResultSet rs = null;

try {
// Establish the connection.
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
con = DriverManager.getConnection(connectionUrl);

I may have something wrong in my syntax. I can connect to the table from ms ssms. The database name is test2 and the table name is TestTable2. I get the following error.
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''. ClientConnectionId:

Thanks
Re: Java mewbe/student - ms sql connectionstring login failed for user [message #1718027 is a reply to message #1717945] Fri, 18 December 2015 10:50 Go to previous message
Eclipse UserFriend
These forums are for questions specifically about using Eclipse, not general programming advice. Try StackOverflow.com for general programming Q&A.
Previous Topic:Eclipse doesn't start after installing german language pack
Next Topic:Using New Installer on Mac
Goto Forum:
  


Current Time: Sat Apr 19 15:07:52 EDT 2025

Powered by FUDForum. Page generated in 0.08433 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top