Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Connect Java to SQL Server database -- com.microsoft.sqlserver.jdbc.SQLServerException: Login failed

 
Gary Grubb
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am havine an issue connecting my Java code to a remote SQL Server database. I Googled for an answer to this issue, but the answer is always the same, i.e. wrong username & password. I am using this username & password connecting to the same remote database from a VB.NET program on the same server wothout issue.
I can also log in to this database with the same username and password as well.

There has got be be something I am missing. Here is the error message... there isn't anything particularly helpful in the rest of the error stack:

com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'omnireport'.


 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you see this discussion?
 
Jan Cumps
Bartender
Posts: 2618
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gary. Welcome to JavaRanch.

I have hidden the password and servername in your code. That server seems to be reachable from the internet.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!