2

I have created a user dsn named "harshi"
To insert rows in a table getting data from Java code I want to insert in SQL table. The connection statement is:

String url = "jdbc:odbc:Harshi"; 
Connection conn = DriverManager.getConnection(url,"",""); 
Statement st = conn.createStatement(); 

Still I am getting output as:

Got an exception!
[Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied.

How can I solve it?

0

1 Answer 1

1

To troubleshoot this error, try one of these:

  • does the DSN contain good credentials?
  • If using SQL Server Authentication, try logging in using those exact credentials via SQL Server Management Studio
  • If using Windows Authentication, does the account making the request have permissions to the SQL Server?
  • Are there any firewalls in between the application machine and the database machine?
  • Has the IP address of the destination machine changed since the DSN was created?
  • Try deleting & recreating the DSN.
Sign up to request clarification or add additional context in comments.

Comments

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.