my dog learned polymorphism
The moose likes JDBC and Relational Databases and the fly likes dsn less connections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "dsn less connections" Watch "dsn less connections" New topic

dsn less connections

Bhupendra Malviya

Joined: Oct 01, 2003
Posts: 15
I am new to jdbc programming. Can you please tell me how to make dsn less connection to major databases like SQL Server, Oracle etc.
Thanking u all in advance
Gowher Naik
Ranch Hand

Joined: Feb 07, 2005
Posts: 643
i am also trying to connect sql server with java application.i got somthing from net but is donot work in muy code,i think it need some kind of driver.

Properties p=new Properties();
p.put("test","DRIVER={SQL Server};ServerName=sw8;UID=wh1;PWD=wh1");
String sConnect =new String("jdbc:sw8://,");
con = DriverManager.getConnection(sConnect,p);
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

Welcome to JavaRanch!

Yes, you need a driver. It comes with your database. As an alternative, you can download the JDBC driver from Microsoft.

Also, note that the original question is a year and a half old. It's ok to start a new thread in the future.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: dsn less connections
It's not a secret anymore!