Solved

jdbc:sqlserver driver  "Request Attention"

Posted on 2012-04-05
3
272 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 28

Assisted Solution

by:Ryan McCauley
Ryan McCauley earned 500 total points
ID: 37815236
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
ID: 37815306
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
ID: 37816221
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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

617 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