Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

com.thinweb.tds.Driver for Ms SQL 7

sean zang
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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(
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic