File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes  com.thinweb.tds.Driver  for Ms SQL 7 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 " com.thinweb.tds.Driver  for Ms SQL 7" Watch " com.thinweb.tds.Driver  for Ms SQL 7" New topic

com.thinweb.tds.Driver for Ms SQL 7

sean zang
Ranch Hand

Joined: Apr 22, 2000
Posts: 33
Hi ,All
Does anybody use JDBC driver( type4) to connect with MS SQL server 7.0?
i try to test this driver but failed?
Does anyone figure out whats problem with following code:
mport java.sql.*;
class TestMsql7 {
public static void main(String argv[]) {
try {
String url = "jdbc:twtds:sqlserver://;CHARSET=cp950;TDS=4.2";
System.out.println("Attempting to connect..");
Connection con = DriverManager.getConnection(url,"sa","");
System.out.println("Connection establised");
// Create statement
Statement stmt = con.createStatement();
// Execute query
String query = "select * from sales";
// Obtain the result set
ResultSet rs = stmt.executeQuery(query);
System.out.println("JDBC SQL Query : "+query);
System.out.println("Results : ");
// Loop through each result row
while( { // Null point exception
// Print out each field as a string
catch( Exception e ) {
Run Result:
Attempting to connect..
Connection establised
JDBC SQL Query : select * from sales
Results :
at com.thinweb.tds.Tds.b(Unknown Source)
at com.thinweb.tds.Tds.a(Unknown Source)
at Source)
at TestMsql7.main(
I agree. Here's the link:
subject: com.thinweb.tds.Driver for Ms SQL 7
It's not a secret anymore!