Solved

Cant get a DB connnection URL right

Posted on 2006-06-13
4
242 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
[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
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

763 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