File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes Connect Java to SQL Server database -- Login failed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connect Java to SQL Server database -- Login failed" Watch "Connect Java to SQL Server database -- Login failed" New topic

Connect Java to SQL Server database -- Login failed

Gary Grubb

Joined: Oct 07, 2010
Posts: 1
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: Login failed for user 'omnireport'.

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Did you see this discussion?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Jan Cumps

Joined: Dec 20, 2006
Posts: 2476

Hi Gary. Welcome to JavaRanch.

I have hidden the password and servername in your code. That server seems to be reachable from the internet.

OCUP UML fundamental and ITIL foundation
youtube channel
I agree. Here's the link:
subject: Connect Java to SQL Server database -- Login failed
Similar Threads
JDBC Connection to Unidata is troubling me can any help please
Trouble Connectiing
SQL Server 2008r2 Connection Failed