JDBC Connection to MS SQL Server 2000 
Author Message
 JDBC Connection to MS SQL Server 2000

I am working on a school project which requires
database connection to Microsoft SQL server 2000
through JDBC-ODBC bridge.

Database Server: MS SQL Server 2000
OS: Window XP professional
Java Version: 1.4.1_02
Driver: Microsoft SQL Server 2000 Driver for JDBC
Data Source: funfoo (added through ODBC)

My Java code:
====================================================
import java.sql.*;

public class MyODBC
{
   public static void main(String args[])
   {
      try
      {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         String sourceURL
= "jdbc:Microsoft:sqlserver://funfoo;User=sa;Password=feng
gui";
         Connection databaseConnection =
DriverManager.getConnection(sourceURL);            
      }
      catch(ClassNotFoundException e)
      {
         System.err.println(e);
      }
      catch(SQLException e)
      {
         System.err.println(e);
      }
   }

Quote:
}

====================================================

The above code throws exception as follows:

java.sql.SQLException: No suitable driver

The Java program is run on the same machine that hosts
the MS SQL server 2000.  The data source is funfoo
which is added through ODBC.  

I don't know how to solve the above exeption.  I am
wondering if you would give me a hint on the database
connection issue?

Feng



Thu, 08 Sep 2005 15:33:30 GMT
 JDBC Connection to MS SQL Server 2000

Quote:

> I am working on a school project which requires
> database connection to Microsoft SQL server 2000
> through JDBC-ODBC bridge.

The exception means that your URL is not exactly what the jdbc-odbc bridge expects.
Joe
Quote:

> Database Server: MS SQL Server 2000
> OS: Window XP professional
> Java Version: 1.4.1_02
> Driver: Microsoft SQL Server 2000 Driver for JDBC
> Data Source: funfoo (added through ODBC)

> My Java code:
> ====================================================
> import java.sql.*;

> public class MyODBC
> {
>    public static void main(String args[])
>    {
>       try
>       {
>          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>          String sourceURL
> = "jdbc:Microsoft:sqlserver://funfoo;User=sa;Password=feng
> gui";
>          Connection databaseConnection =
> DriverManager.getConnection(sourceURL);
>       }
>       catch(ClassNotFoundException e)
>       {
>          System.err.println(e);
>       }
>       catch(SQLException e)
>       {
>          System.err.println(e);
>       }
>    }
> }

> ====================================================

> The above code throws exception as follows:

> java.sql.SQLException: No suitable driver

> The Java program is run on the same machine that hosts
> the MS SQL server 2000.  The data source is funfoo
> which is added through ODBC.

> I don't know how to solve the above exeption.  I am
> wondering if you would give me a hint on the database
> connection issue?

> Feng



Thu, 08 Sep 2005 23:03:34 GMT
 JDBC Connection to MS SQL Server 2000
Hi Joe:

I am not sure the correct URL string to set up the
connection to MS SQL Server 2000.

I downloaded the Microsoft SQL Server 2000 driver for
JDBC and installed it.

You mentioned that my URL string in the code is not
right.  What is the right URL string for
DriverManager.getConnection(URL)?

Is there any sample code available online?  Can you help
me?  I would really appreciate your advice.

Feng

Quote:
>-----Original Message-----


>> I am working on a school project which requires
>> database connection to Microsoft SQL server 2000
>> through JDBC-ODBC bridge.

>The exception means that your URL is not exactly what

the jdbc-odbc bridge expects.
Quote:
>Joe

>> Database Server: MS SQL Server 2000
>> OS: Window XP professional
>> Java Version: 1.4.1_02
>> Driver: Microsoft SQL Server 2000 Driver for JDBC
>> Data Source: funfoo (added through ODBC)

>> My Java code:
>> ====================================================
>> import java.sql.*;

>> public class MyODBC
>> {
>>    public static void main(String args[])
>>    {
>>       try
>>       {
>>          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>>          String sourceURL

= "jdbc:Microsoft:sqlserver://funfoo;User=sa;Password=feng

- Show quoted text -

Quote:
>> gui";
>>          Connection databaseConnection =
>> DriverManager.getConnection(sourceURL);
>>       }
>>       catch(ClassNotFoundException e)
>>       {
>>          System.err.println(e);
>>       }
>>       catch(SQLException e)
>>       {
>>          System.err.println(e);
>>       }
>>    }
>> }

>> ====================================================

>> The above code throws exception as follows:

>> java.sql.SQLException: No suitable driver

>> The Java program is run on the same machine that hosts
>> the MS SQL server 2000.  The data source is funfoo
>> which is added through ODBC.

>> I don't know how to solve the above exeption.  I am
>> wondering if you would give me a hint on the database
>> connection issue?

>> Feng

>.



Fri, 09 Sep 2005 06:57:30 GMT
 JDBC Connection to MS SQL Server 2000

Quote:

> Hi Joe:

> I am not sure the correct URL string to set up the
> connection to MS SQL Server 2000.

> I downloaded the Microsoft SQL Server 2000 driver for
> JDBC and installed it.

> You mentioned that my URL string in the code is not
> right.  What is the right URL string for
> DriverManager.getConnection(URL)?

> Is there any sample code available online?  Can you help
> me?  I would really appreciate your advice.

If you've installed the SQLServer driver, read it's documentation that got
installed with it. That will giive you all the info you need.
Joe
Quote:

> Feng

> >-----Original Message-----


> >> I am working on a school project which requires
> >> database connection to Microsoft SQL server 2000
> >> through JDBC-ODBC bridge.

> >The exception means that your URL is not exactly what
> the jdbc-odbc bridge expects.
> >Joe

> >> Database Server: MS SQL Server 2000
> >> OS: Window XP professional
> >> Java Version: 1.4.1_02
> >> Driver: Microsoft SQL Server 2000 Driver for JDBC
> >> Data Source: funfoo (added through ODBC)

> >> My Java code:
> >> ====================================================
> >> import java.sql.*;

> >> public class MyODBC
> >> {
> >>    public static void main(String args[])
> >>    {
> >>       try
> >>       {
> >>          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
> >>          String sourceURL

> = "jdbc:Microsoft:sqlserver://funfoo;User=sa;Password=feng
> >> gui";
> >>          Connection databaseConnection =
> >> DriverManager.getConnection(sourceURL);
> >>       }
> >>       catch(ClassNotFoundException e)
> >>       {
> >>          System.err.println(e);
> >>       }
> >>       catch(SQLException e)
> >>       {
> >>          System.err.println(e);
> >>       }
> >>    }
> >> }

> >> ====================================================

> >> The above code throws exception as follows:

> >> java.sql.SQLException: No suitable driver

> >> The Java program is run on the same machine that hosts
> >> the MS SQL server 2000.  The data source is funfoo
> >> which is added through ODBC.

> >> I don't know how to solve the above exeption.  I am
> >> wondering if you would give me a hint on the database
> >> connection issue?

> >> Feng

> >.



Fri, 09 Sep 2005 08:06:52 GMT
 JDBC Connection to MS SQL Server 2000
Hi Joe:

Thank you for your advice.

Feng

Quote:
>-----Original Message-----


>> Hi Joe:

>> I am not sure the correct URL string to set up the
>> connection to MS SQL Server 2000.

>> I downloaded the Microsoft SQL Server 2000 driver for
>> JDBC and installed it.

>> You mentioned that my URL string in the code is not
>> right.  What is the right URL string for
>> DriverManager.getConnection(URL)?

>> Is there any sample code available online?  Can you
help
>> me?  I would really appreciate your advice.

>If you've installed the SQLServer driver, read it's

documentation that got

- Show quoted text -

Quote:
>installed with it. That will giive you all the info you
need.
>Joe

>> Feng



Fri, 09 Sep 2005 17:59:37 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

2. Problem with Connection Pervasive SQL 2000 an MS SQL Server 7.0

3. Pervasive SQL 2000 Connection from MS SQL 2000

4. UPDATETEXT problem with MS SQL Server 2000 JDBC

5. queryDataSet.execute()+ms jdbc driver+sql server 2000

6. Compatibility JDK 1.4.0 with JDBC Driver for MS SQL Server 2000

7. How to use MS SQL server 2000 JDBC driver in AIX

8. MS SQL Server 2000 Driver for JDBC

9. Error when installing the MS JDBC driver for SQL Server 2000

10. WebSphere App Server w/MS SQL 2000 JDBC Driver

11. jdbc driver for MS SQL Server 2000

12. MS SQL Server 2000 JDBC Beta : Bug while using DatabaseMetaData.getColumns() method


 
Powered by phpBB® Forum Software