Solved

jdbc:sqlserver driver  "Request Attention"

Posted on 2012-04-05
3
256 Views
Last Modified: 2012-04-09
hello:
I am trying to map a SQL server 2008r2:
and this is the convention I found on the net:

jdbc:sqlserver://server:port;DatabaseName=dbname

so I fill in:

jdbc:sqlserver://MyMachine\SQL Instance name:1433; XYZ=?????

The question is this:
DatabaseName=dbname - are not those the same (why would I put dbabasename=dbname)?

Is placing the IP of the machine better than  placing MyMachine\SQL Instance name ?


Thank you.
0
Comment
Question by:noamco36
  • 2
3 Comments
 
LVL 28

Assisted Solution

by:Ryan McCauley
Ryan McCauley earned 500 total points
Comment Utility
If you're connecting to the default instance (on port 1433), and it appears that you are, I suspect you can omit the "SQL Instance Name:1433" segment of your connection string. You'll probably just need something like:

jdbc:sqlserver://MyMachine;DatabaseName=SomeDbOnYourServerThatYoureAccessing

Open in new window


The "DatabaseName" identifier is literal - what you'll want to change is the value after it, which tells the JDBC driver which database you'll be accessing. You can always switch database context after you connect, or access data from another database you have rights to, but it just tells you where you're starting.

I'd actually favor using the server's DNS name ("MyMachine" above) instead of the IP address - it makes it easier if you have to change the IP address of the server later.
0
 

Author Comment

by:noamco36
Comment Utility
so do you mean it should be like this?

jdbc:sqlserver://MyMachine;XYZdb
 
or mayby:

jdbc:sqlserver://Chats101;AdventureWorks

or maybe:

jdbc:sqlserver://192.168.1.64;AdventureWorks


are any of those wrong?
0
 
LVL 28

Accepted Solution

by:
Ryan McCauley earned 500 total points
Comment Utility
Do any of those work?

I've not used jdbc to connect before, but I'd expect it to be like this (for clarify, only the italic text should be edited by you - everything else should stay the same):

jdbc:sqlserver://MyMachine;DatabaseName=AdventureWorks

The "DatabaseName" identified should be in your string, and you provide the database name to the right of the = sign, so you'll only change the IP (if needed) and replace "AdventureWorks" with the name of your database.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now