943,522 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 6732
  • Java RSS
May 6th, 2004
0

JDBC connection

Expand Post »
Im new to java programming.
I want to establish a connection to
my MS-sql database using java.
How do i do it?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
HiTleR83 is offline Offline
3 posts
since May 2004
May 20th, 2004
0

Re: JDBC connection

First declare your URL (in string format of cours
Remember your URL is
1 a String
2 "jdbc:odbc:"+dataSourceName;

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")//often the standard;
Connection con = DriverManager.getConnection(url,"username","password");
Statement stmt = con.createStatement();

this is as far as connection goes
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hakeem46 is offline Offline
2 posts
since May 2004
May 20th, 2004
0

Re: JDBC connection

Quote ...
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")//often the standard;
Case Sensitive
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Compilation problem
Next Thread in Java Forum Timeline: Class Passing and Returning Arrays





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC