Solved

Cant get a DB connnection URL right

Posted on 2006-06-13
4
238 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
Comment Utility
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__
Comment Utility
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
Comment Utility
Also, try:

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

Tim
0
 

Author Comment

by:CoreSupport
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

762 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

11 Experts available now in Live!

Get 1:1 Help Now