This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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: 2543

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
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Connect Java to SQL Server database -- Login failed
It's not a secret anymore!