• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dsn less connections

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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
Bhupendra
 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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://192.168.0.11/,");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection(sConnect,p);
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gowher,
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic