Solved

Cant get a DB connnection URL right

Posted on 2006-06-13
4
241 Views
Last Modified: 2008-03-10
Hi all,
I have an application which is connecting to a remote SQL SERVER database.
I originally developed the application and pointed it to my local SQL SERVER database using the following database url:
jdbc:microsoft:sqlserver://localhost:1433

I had a user set up in SQL server called coretestuser with a password.
In sql server this user was only asssociated with one database (DTTest) so SQL sever somehow worked out which database to use.

Now I have to use a different database on 10.0.0.5 and I cant connect to it.
I cant create a test user as the account I have been given is used on several databases!
I cant seem to get the database name working at all.

I ve tried:
url = "jdbc:microsoft:sqlserver://10.0.0.5:1433;Database=DTTest";

and

url = "jdbc:microsoft:sqlserver://10.0.0.5:1433/DTTest";

Neither is working I just get "Unable to connect.  Invalid URL"
Am i missing something really obvious??
Thanks
D
0
Comment
Question by:CoreSupport
  • 2
4 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 16895014
What do you get if you type:

    ping 10.0.0.5

on the command prompt?

10.* addresses are usually reserved for an internal network...I assume you are trying to run the client on the same network (ie: not externally on a different subnet?)

Tim
0
 
LVL 8

Expert Comment

by:colr__
ID: 16895023
Is you firewall setup to allow outbound requests on the sql server port? This is a very common problem with trying to connect to a remote DB, as these ports will be closed as standard.

The port is 1433 I think.

colr__
0
 
LVL 35

Accepted Solution

by:
TimYates earned 125 total points
ID: 16895033
Also, try:

    url = "jdbc:sqlserver://10.0.0.5;databaseName=DTTest" ;

Tim
0
 

Author Comment

by:CoreSupport
ID: 16895156
Brilliant guys!
url = "jdbc:sqlserver://10.0.0.5;databaseName=DTTest" ;

this worked!
that was wreckin my head all day! thanks!!
Legends!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
configure dependency in POM for new database 3 34
arguments to jar 5 35
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 57
jboss 7.1 start up error 1 40
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

829 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