• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Lightweight jdbc driver to connect to SQL server 2005

 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am building an desktop application in which i need to connect to SQL Server 2005 database.I am thinking of lightweight jdbc driver to connect to SQL server 2005.Please help me on thoughts on this.What i am actually trying to do is if i install this application on any machine they should be able to do CRUD operation with out creating any DSN.

Regards
Sudhakar
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IsnĀ“t the SQL Server 2005 JDBC driver lightweight? You may consider the jTDS JDBC driver.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "lightweight" in this context? Surely a jar file a few 100KB in size presents no problem in this day and age?
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to admit that i know little about JDBC drivers.I just googled and followed as explained in this http://www.java-tips.org/other-api-tips/jdbc/how-to-connect-microsoft-sql-server-using-jdbc.html

Thanks
Sudhakar
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That page doesn't contain the word "lightweight" ...?

The http://faq.javaranch.com/java/GeneralJdbcQuestions page links to both jTDS and the MS SQLServer 2005 driver.
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That page doesn't contain the word "lightweight" ...?

I exactly dont know what is Lightweight but my intention was to avoid creating DNS.and i am able to acheive following this link http://www.java-tips.org/other-api-tips/jdbc/how-t...oft-sql-server-using-jdbc.html

Regards
Sudhakar
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karnati Sudhakar wrote:but my intention was to avoid creating DNS
This makes no sense.

Just load the driver by Class#forName() yourself and use DriverManager#getConnection() to get a connection. Voila, no need for a DSN. This is regardless of the JDBC driver. The DSN is just some higher level abstraction which allows you to externalize the connection settings and/or make use of connection pooling capabilities to improve performance.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bauke Scholtz wrote:This makes no sense. ... Voila, no need for a DNS.

So I guess it does make sense, and it's rather easily achieved. :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic