X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A036B3AAD2E for ; Fri, 10 Dec 2004 21:32:00 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70473-07 for ; Fri, 10 Dec 2004 21:31:23 +0000 (GMT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by svr1.postgresql.org (Postfix) with ESMTP id ADDF43ABDA0 for ; Fri, 10 Dec 2004 18:43:14 +0000 (GMT) Received: from web10911.mail.yahoo.com (web10911.mail.yahoo.com [216.136.131.134]) by svr4.postgresql.org (Postfix) with SMTP id AE43C5B346D for ; Thu, 9 Dec 2004 06:10:38 +0000 (GMT) Received: (qmail 93129 invoked by uid 60001); 9 Dec 2004 06:08:37 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=cmdj20CaJXdFa5agjvvYGFx6ZCgWItZ3rFbn4m13u4v0/J9/vOW/8+dfbA6Jqwkn7IuouoxfoxuxNESkk3NOzeFiDe9n7BiDciajhl66utwiOfQZHZxHR4LmKZ2/guC4bnKs1Ack1xtPGMI1jrtsNC4R/3EA7nSL6VJHYR9cnlw= ; Message-ID: <20041209060837.93127.qmail@web10911.mail.yahoo.com> Received: from [202.63.113.66] by web10911.mail.yahoo.com via HTTP; Wed, 08 Dec 2004 22:08:37 PST Date: Wed, 8 Dec 2004 22:08:37 -0800 (PST) From: rajitha m Subject: suitable driver not found To: pgsql-admin@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-639627602-1102572517=:90921" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.461 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, HTML_40_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200412/94 X-Sequence-Number: 15680 --0-639627602-1102572517=:90921 Content-Type: text/plain; charset=us-ascii The code given below gives an exception as: a suitable driver not found. I am not working on a network, it is a simple stand alone PC. Which SqlDriverr would be suitable,I am using SqlServerDriverfor SQl database 7.0,j2sdk1.41_01 and have installed SqlServerDriver driver sqlserverdriver.jar and put it in j2sdk1.41_01/jre/lib/ext/sqlserverdriver.jar and then set the classpath but while running this program i am getting the error like: classnotfound exception:java.lang.classnotfoundexception:com.microsoft.jdbc.sql server:SqlServerDriver sqlexception:java.sql.sqlexception:no suitabledriver and code is: import java.sql.*; import javax.sql.*; import java.io.*; import java.lang.*; public class connect { public static void main(String[] args) { String url = "jdbc:microsoft:sqlserver://idealab5.cs.uiowa.edu:1433;DatabaseName=Entertainment;"; // here Entertainment is database name String uid = "admin"; String pw = ""; try { // Load driver class Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); } catch (java.lang.ClassNotFoundException e) { System.err.println("ClassNotFoundException: " +e); } Connection con = null; try { con = DriverManager.getConnection(url,uid,pw); Statement stmt = con.createStatement(); ResultSet rst = stmt.executeQuery("SELECT * FROM USERS"); //System.out.println("Product Name, Price"); while (rst.next()) { System.out.println(rst.getString(1));//+","+rst.getDouble(2)); } } catch (SQLException ex) { System.err.println("SQLException: " + ex); } finally { if (con != null) try { con.close(); } catch (SQLException ex) { System.err.println("SQLException: " + ex); } } } } --------------------------------- Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. --0-639627602-1102572517=:90921 Content-Type: text/html; charset=us-ascii
 
The code given below gives an exception as:
a suitable driver not found. 
I am not working on a network, it is a simple stand alone PC.
 
Which SqlDriverr would be suitable,I am using SqlServerDriverfor SQl database 7.0,j2sdk1.41_01 and have installed SqlServerDriver driver sqlserverdriver.jar

and put it in j2sdk1.41_01/jre/lib/ext/sqlserverdriver.jar and then set the classpath
but while running this program i am getting the error like:
 
  classnotfound exception:java.lang.classnotfoundexception:com.microsoft.jdbc.sql
server:SqlServerDriver
sqlexception:java.sql.sqlexception:no suitabledriver
 
and code is:
 
  import java.sql.*;
import javax.sql.*;
import java.io.*;
import java.lang.*;
public class connect
{ public static void main(String[] args)
 { String url = "jdbc:microsoft:sqlserver://idealab5.cs.uiowa.edu:1433;DatabaseName=Entertainment;";
// here Entertainment is database name
  String uid = "admin";
  String pw = "";
  try { // Load driver class
   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
  }
  catch (java.lang.ClassNotFoundException e) {
   System.err.println("ClassNotFoundException: " +e);
  }
  Connection con = null;
  try {
   con = DriverManager.getConnection(url,uid,pw);
   Statement stmt = con.createStatement();
   ResultSet rst = stmt.executeQuery("SELECT * FROM USERS");
   //System.out.println("Product Name, Price");
   while (rst.next())
   { System.out.println(rst.getString(1));//+","+rst.getDouble(2));
   }
  }
  catch (SQLException ex)
  {
   System.err.println("SQLException: " + ex);
  }
  finally
  {
   if (con != null)
    try
    {
     con.close();
    }
    catch (SQLException ex)
    {
     System.err.println("SQLException: " + ex);
    }
  }
 }
}
 


Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses. --0-639627602-1102572517=:90921--