Driver For JDBC With Ms SQL Server 7.0

I currently doing a simple Java applet that allow users to enter the data.  The applet will using Microsoft SQL Server 7.0 as database.  I facing the error message "not suitable driver"  when execute the program.  Can anyone tell what driver I need to use and where I can download it.  Below is the source code.  Hope that somebody will help me solve the problem adn reply me thru

import java.awt.*;
import sun.applet.AppletSecurity.*;
import sun.applet.*;
import java.applet.Applet.*;
import java.awt.event.*;
import java.applet.*;
import java.sql.*;
import sun.jdbc.odbc.*;
import java.util.*;

class Person{

      String FName, LName, EMail;
      long id;

      public void Print(){
            System.out.println(FName + "\t" + LName + "\t" + EMail);

Person(long l, String fn, String ln, String em){
            FName = fn;
            LName = ln;
            EMail = em;
            id = l;

public class PeopleMaker extends Applet implements ActionListener{

      Button btnAdd;
      TextField txtFName,txtLName,  
      Label lblFName, lblLName,
      public void init(){
      setLayout(new GridLayout  

      lblFName = new Label("First
      txtFName = new TextField(30);

      lblLName = new Label
        ("Last Name:");

      txtLName = new TextField(30);

      lblEMail = new Label("EMail
      txtEMail = new TextField(30);

      btnAdd = new Button("Add

      public void actionPerformed
        (ActionEvent e){
      if (e.getSource() == btnAdd){
                  String SQLQuery;
         = "INSERT INTO SPR (FName,
         LName, EMail) VALUES ('" +
                               txtFName.getText() + "', '" +
                               txtLName.getText() + "', '" +
                               txtEMail.getText() + "');";


                        Connection con =
                        Statement stmt =
      int recordcount =
                  catch (Exception x) {

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JdbcOdbc bridge is not a good choice for applets (you have to configure ODBC data source name on the client machine)

get some real Jdbc driver
HuangAunAuthor Commented:
Thanks,  Vladi21
U mentioned that JdbcOdbc bridge is not a good choice for applets .  So what ur opinion for the better driver in MS SQL Server.  Then what U mean with ODBC data source configuration in client machine.  I have take a look the at side.  But I cant get enough information from there.  I also confused
with what the suitable driver. Can U explain more details.  Thanks.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

JdbcOdbc bridge
1. uses native code (ordinary applets are not allowed to use native code)
2. works only on Windows machines (?)
3. needs configuration on the client machine (Control Panel / ODBC / Configure new ODBS datasource)

so it is not suitable for applets.
I haven't used MS SQL and I don't have my bookmarks, so I can't recomend you Jdbc driver, but take a look at the URL, get the drivers and try them (they probably have some gfood examples)
also look:

Java Database Connectivity is a standard SQL database access interface, providing uniform access to a wide range of relational databases. It also provides a common base on which higher level tools and interfaces can be built. This comes with an "ODBC Bridge" (except on Mac 68K). The Bridge is a library which implements JDBC in terms of the ODBC standard C API.

Writing Advanced Applications Chapter 4: JDBC Technology

JDBC basics by Thornton Rose (example programs by April Rose)

JDBC and Database Programming in Java (good quick overview with images :)

Silicaon Valley Java SIG JDBC Talk Page

Java how-to DB section!

articles from Oracle:

articles from javaworld:

JDBC 2.0 New Features

MS bridge
HuangAunAuthor Commented:
Hi! : Heyhey
Thanks for U reply answer.
U said that get the real JDBC driver.
ut I didnt know whcih driver I need to install and where I can download it.
Please guide me on it.


HuangAunAuthor Commented:
Hi! Vladi21
Very thanks for ur reply.  I still confused with th edriver I need to install for me to access Ms SQL Server 7.0.  What the driver manager I should type for bellow connection :-

Class.forName         ("sun.jdbc.odbc.JdbcOdbcDriver");

Connection con =


You have to use type3 and type4 drivers for applets accessing database drivers.

not jdbcodbc bridge.

 From: Jod
 Date: Thursday, November 18 1999 - 02:40AM CST  
Look here for details on oracle (as an example) 

For example:

JDBC Thin Driver

The Oracle JDBC Thin driver is a 100% Pure Java implementation that complies with the JDBC 1.22
 standard. The JDBC Thin driver uses Java Sockets to connect directly to the Oracle Server and
is typically used for Java applets in either a two-tier or three-tier configuration, though
 it can also be used for Java applications. The JDBC Thin driver provides its own
implementation of a TCP/IP version of Oracle's Net8. Because it is written entirely in Java,
 this driver is platform-independent. When the JDBC Thin driver is used with an applet,
 the client browser must have the capability to support Java sockets.

The JDBC Thin driver does not require Oracle software on the client side;
 it can be downloaded into a browser simultaneously with the Java applet being run.
 From the client (usually a browser), you select a URL from an HTML page that contains a
Java applet tag. The web server downloads the Java applet and the JDBC Thin driver to the
 client. The JDBC Thin driver then establishes a direct connection to the database server
using Java Sockets.

The JDBC Thin driver connects to any Oracle database of version 7.2.3 and higher.
 The JDBC Thin driver allows a direct connection to the database by emulating Net8 and
 TTC (the wire protocol used by OCI) on top of Java sockets. The driver supports
only TCP/IP protocol and requires a TNS listener to be listening on TCP/IP sockets
from the database server.

There are four types of driver that Java can use to connect to a database directly:

1.The JDBC-ODBC bridge provides JDBC access via most ODBC drivers.

2.A native-API partly-Java driver converts JDBC calls into calls on the client
  API for Oracle, Sybase, Informix, DB2, or other databases.

3.A net-protocol pure-Java driver translates JDBC calls into a database-independent
   net protocol which is then translated to a proprietary database vendor network protocol
  by a server.

4.A native-protocol pure-Java driver converts JDBC calls into a proprietary database vendor
 network protocol.

A Type 3 driver can connect directly from the client to the Server and a two-tier
 type 4 driver could also do this if it connects directly across the network to the database
 server because neither of these types of driver have any dependence on software installed
 on the client.

Other types of driver require the applet to be signed in order to access local propritary
 code to get to the database.

None of these specifically require RMI, but you will need to check what support
 fetures your server has for JDBC connections.

There is lots of info here: 

and amongst others, some overviews here: 

 Type 3 and type 4 expensive drivers.

Two solutions for you.

1. Uisng type 3 and type 4 drivers.

2. Writing database login in java servlets and calling servlets from applet through URLConnection class.
Best of luck
As so many of them asnwered JdbcOdbc driver is not a good choice for applets.
This will work fine with intranets
You have to use a Type-3 JDBC driver.
You can go to and download the evaluation copy of ids  driver. This is a type-3 driver which is able to connect to MS SQl server or virtually any Database. Then you can connect using that.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

How can I use the JDBC API to access a desktop database like Microsoft Access over the network?

Most desktop databases currently require a JDBC solution that uses ODBC underneath.
This is because the vendors of these database products haven't implemented all-Java JDBC drivers.

The best approach is to use a commercial JDBC driver that supports ODBC and the database you
want to use. See the JDBC drivers page for a list of available JDBC drivers.

The JDBC-ODBC bridge from Sun's Java Software does not provide network access to desktop databases
by itself. The JDBC-ODBC bridge loads ODBC as a local DLL, and typical ODBC drivers for desktop databases
like Access aren't networked. The JDBC-ODBC bridge can be used together with the RMI-JDBC bridge ,
however, to access a desktop database like Access over the net. This RMI-JDBC-ODBC solution is free. 

also look 

Java how-to DB section! 


It's alreday given vladi21 comments
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.