JSP, Sql Server 2000 Driver, classpath

Hello All,
I've got a really weird problem here.
I want to connect a JSP page to a SQL Server 2000 database.
I downloaded the SQL Server 2000 Driver for JDBC, and it seems to have installed fine.
Next I write a regular java program to test the connection. It works fine, I get a "Connection Successful message". Here' the code:
import java.sql.*;
public class MSSqlServerJDBCTest {
    public static void main( String args[] ) {
        Connection conn;
        if ( args.length != 3 ) {
            System.out.println( "Usage: java MSSqlServerJDBCTest "
                + "<server> <username> <password>" );
        } else {
            try {
                String serverName = args[ 0 ];
                String userName = args[ 1 ];
                String password = args[ 2 ];
                String connStr = "jdbc:microsoft:sqlserver://"
                    + serverName + ":1433";
                Class.forName( "com.microsoft.jdbc.sqlserver.SQLServerDriver" );
                conn = DriverManager.getConnection(
                    connStr, userName, password );
                System.out.println( "Connection successful" );
                conn.close();
            catch ( SQLException e ) {
                System.err.println( "SQL Exception: " + e.getMessage() );
            catch( ClassNotFoundException e ) {
                System.err.println( "SQL Server JDBC Driver Not Found!!" );
}Now, when I include similar into a JavaBean, which is used in a JSP, I get a classNotFound exception:
Exception occured: java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriverSo then I checked out the classpath a few times using echo %classpath%
Everything seemed okay, the driver jars are in the path, but the JSP can't find the driver.
I looked at the System.out file in the j2sdkee1.3.1\logs..... directory.
The start of the file contains this stuff:
Logging for J2EE Server Version: 1.3.1-b17 started at: Fri Nov 08 17:31:53 GMT 2002..
Using the Java HotSpot(TM) Client VM and the version number 1.3.1_02 from Sun Microsystems Inc..
VM is using the classpath: c:\j2sdkee1.3.1\lib\system\cloudscape.jar;c:\j2sdkee1.3.1\lib\system\tools.jar;c:\j2sdkee1.3.1\lib\cloudscape\RmiJdbc.jar;c:\j2sdkee1.3.1\lib\cloudscape\cloudclient.jar;c:\j2sdkee1.3.1\lib\classes;c:\j2sdkee1.3.1\classes;c:\j2sdkee1.3.1\lib\j2ee.jar;c:\j2sdkee1.3.1\lib\toolclasses;c:\j2sdkee1.3.1\lib\j2eetools.jar;c:\j2sdkee1.3.1\lib\locale;;c:\jdk1.3.1_02\lib\tools.jar;c:\j2sdkee1.3.1\lib\jhall.jar .
J2EE Home Directory has been set to: c:\j2sdkee1.3.1.Look at the classpath - its different from when I do an echo %classpath% from the command line. Notice also it DOESN'T contain the driver jars that I need. This is probably why I can connect from a regular java program, but not from within J2EE.
So where does this leave me? How can I change the classpath so that the changes are seen from within the J2EE container?
Please help,
Thanks in advance,
Ruzer

I modified the C:\j2sdkee1.3.1\bin\userconfig.bat file with the line:
set J2EE_CLASSPATH=c:\sqldriver\msutil.jar;c:\sqldriver\mssqlserver.jar;c:\sqldriver\msbase.jarI had to change the location of the MS SQLServer 2000 driver cos J2EE.bat wouldn't start with the original location. I don't think it liked the spaces.
Now I get a different exception:
java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
     at java.security.AccessController.checkPermission(AccessController.java:399)
     at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
     at com.sun.enterprise.J2EESecurityManager.checkAccess(J2EESecurityManager.java:46)
     at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:279)
     at java.lang.Thread.init(Thread.java:265)
     at java.lang.Thread.(Thread.java:330)
     at com.microsoft.jdbc.base.BaseGarbageThread.(Unknown Source)
     at com.microsoft.jdbc.base.BaseGarbageThread.EnsureRunning(Unknown Source)
     at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
     at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
     at java.sql.DriverManager.getConnection(DriverManager.java:517)
     at java.sql.DriverManager.getConnection(DriverManager.java:177)
     at org.apache.jsp.databaseJSP$jsp._jspService(databaseJSP$jsp.java:70)
     at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)not sure why!
Ruadhan

Similar Messages

  • SQL Server 2000 Driver for JDBC - Error establishing sockets

    Hi there
    I am using Microsoft SQL Server 2000 Driver for JDBC to connect to SQL Sever 2000. It is just a test application to see if it would connect to the datacase successfully. But I got the following errors. I already set up the classpath and installed all SQL Server 2000 Driver for JDBC sp 3. Dont know why it still failed...can anyone help me out of this? Thanks.
    When i am using simple JDBC-ODBC bridge Driver it's working fine.
    For this Server Pack3 , i have checked every thing like--
    TCP / IP Poart is Enable.
    I am working in client machine, my MSSQLServer 2000 Placed in server Machine.
    when i am giving Telnet ServerIP 1433 it's giving following response.
    connecting to ServerIP ....... could not open connection to the host , on port 1433:connection Failed
    My Sample Code is :--
    String user="sa";
    String password="imcindia";
    Connection con1 = null;
    CallableStatement cstmt = null;
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
    con1=DriverManager.getConnection("jdbc:microsoft:sqlserver://ServerName:1433;DatabaseName=dmo1o2d",user,password);
    Statement st=con1.createStatement();
    st.execute("use dm0102d");
    st.execute("setuser 'dm01012'");
    cstmt = con1.prepareCall("{?=Call dms_ex_create_folder('ABC','18753','NB21','u')}");
    cstmt.execute();
    Here are Error Code :
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
         at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Connection refused: connect
         at java.sql.DriverManager.getConnection(Unknown Source)
         at TestConnection1.main(TestConnection1.java:24)
    one can help me to over come this problm,
    Thanks in advance.
    venkat

    hey i also have this problem i have been looking for solution for this problem for along time i tried every possible solution i tried every service pack for the SQL but it didn't connect to the port!!!
    it's a network problem ur java code is correct dont worry about it.
    finally i had to install MySQL and it's work fine now but if u insist on usning SQL u have to use the JDBC-ODBC Bridge it will work by :
    first add data source database , follow these steps
    1- go to Administrative tools
    2-Data Sources(ODBC)
    3-System DNS tab and add then choose SQL SERVER the last option then finish
    4-write the name; Note: this name is the one that u will write in ur URL for example if u write Hello the URL will be "jdbc:odbc:Hello"
    5- choose the server, its recommended to write "." or (local)
    6-change the database to its an important step to choose the database that u want to use, choose northwind if u want to use it
    finish
    second
    adding this code:
    import java.sql.*;
    class JdbcTest1 { 
    public static void main (String[] args) { 
    try { 
    // Step 1: Load the JDBC driver.
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    // Step 2: Establish the connection to the database.
    String url = "jdbc:odbc:Hello";
    Connection conn = DriverManager.getConnection(url,"user1","password");
    } catch (Exception e) { 
    System.err.println("Got an exception! ");
    System.err.println(e.getMessage());
    it will work without any problems

  • Problems! MS SQL Server 2000 Driver for JDBC.

    In Dos-promt ill got only this message: com.microsoft.jdbc.sqlserver.SQLServerDriver
    What is wrong and is there someone that can help me out?
    I have installed Microsoft SQL Server 2000 Driver for JDBC and set the path like this in the system, advance, environment variable:
    .;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msbase.jar;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\msutil.jar;D:\Program Files\Microsoft SQL Server 2000 Driver for JDBC\lib\mssqlserver.jar
    This is the source code i use to test the connection:
    import java.sql.*;
    public class Exercise2_1 {
    static String driver = ("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    static String url= "jdbc:microsoft:MinTest;ah;modeerf";//sqlserver://H:1433;user=ah;password=modeerf";
    public static void main(String[] args) {
    try {
         Class.forName(driver).newInstance();
         System.out.println("Loaded driver");
         Connection conn = DriverManager.getConnection(url);
         System.out.println("Connected to database");
         conn.close();
         System.out.println("Closed connection");
    catch (Throwable e) { System.err.println(e.getMessage()); }

    You printed the error message associated with the exception but didn't print the type of the exception. com.microsoft.jdbc.sqlserver.SQLServerDriver was probably a ClassNotFoundException meaning that the VM couldn't find the jars.
    You say you put the jars in the path. They should actually be in the class path. Either set the CLASSPATH environment variable or pass it in to the Java VM via the -cp option.
    One more thing. Seeing as the paths that you installed the JDBC driver into contain spaces you may need to put quotes around the path names or use the MSDOS short names for those directories.
    Col

  • Batch statement with sql server 2000 driver

    Hi,
    I have been using the jdbc bridge and recently upgraded to the sql server 2000 driver. I have some code that was working correctly executing some batch commands. But with the new driver it no longer works. Its throwing errors. Can anyone help? I have tried removing the begin/end statments and that causes a different error to be thrown.
    Statement s = db.createStatement();
    s.addBatch("Begin");
    s.addBatch("use master");
    s.addBatch("EXEC sp_addlogin '" + login +"','" + loginAuth + "','testDB'");
    s.addBatch("use testDB");
    s.addBatch("EXEC sp_grantdbaccess '" + login + "' , '" + login + "'");
    s.addBatch("End");
    s.executeBatch();

    I have been using the jdbc bridge and recently
    upgraded to the sql server 2000 driver. i think you maybe are sol...
    Statement s = db.createStatement();
    s.addBatch("Begin");
    s.addBatch("use master");
    s.addBatch("EXEC sp_addlogin '" +
    p_addlogin '" + login +"','" + loginAuth +
    "','testDB'");
    s.addBatch("use testDB");
    s.addBatch("EXEC sp_grantdbaccess '" +
    ntdbaccess '" + login + "' , '" + login + "'");
    s.addBatch("End");
    s.executeBatch();the documentation from microsoft reads...
    for both CallableStatement and PreparedStatement
    void addBatch (String)
    Not Supported
    Throws "invalid method call" exception.
    is this the error you are seeing?

  • Error establishing socket (Microsoft SQL Server 2000 Driver for JDBC)

    I tray connect to MS-SQL2000 using JDeveloper and retrieve an error: "[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.[Microsoft][SQLServer 2000 Driver for JDBC]PC160832\NCI_DBA_01"
    I followed the steps:
    1 - Install the JDBC Driver for MS-SQL2000
    2 - Create a new AddJavaLibPath :"AddJavaLibPath C:/Program files/Microsoft SQL Server 2000 Driver for JDBC/lib"
    3 - Specify Default Project Libraries: "msbase.jar, msutil.jar and mssqlserver.jar"
    4 - Create a new connection: "Java class name: com.microsoft.jdbc.sqlserver.SQLServerDriver" "URL: jdbc:microsoft:sqlserver://PC160832\NCI_DBA_01:1433;SelectMethod=cursor"
    5 - Retrieve the error: "[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.[Microsoft][SQLServer 2000 Driver for JDBC]PC160832\NCI_DBA_01"

    Were you able to resolve this? If so could you tell me how. I have the same problem.
    Thanks!!!

  • Error Using the SQL Server 2000 Driver for JDBC Service Pack 3

    Hi,
    I�m using the SQL Server 2000 Driver for JDBC Service Pack 3. The connection is succesfully, but when I use de statement.executequery() method, there is the follow exception:
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'PEC_COUNTRY'.
    This is my code:
    ResultSet resultSet;
    Statement statement;
    Connection connection;
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
    connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://S0MALMUERTA:1433;user=sa;password=");
    statement = connection.createStatement();
    resultSet = statement.executeQuery("SELECT COY_INX, COY_NAME, COY_ICO FROM PEC_COUNTRY
    ");When I make the last instruction, occurs the above exception
    Thanks in advance
    Luija

    The way you are connecting, the default database used will be 'master' and i guess that the table PEC_COUNTRY was defined in another database.
    If it is the case you need to specify the database name.
    connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://S0MALMUERTA:1433;DatabaseName=yourdb;user=sa;password=");

  • Regarding Microsoft SQL Server 2000 Driver for JDBC (2.2.0019)

    I have downloaded and installed Microsoft SQL Server 2000 Driver for JDBC (2.2.0019). Now i have to configure it for my development purpose. Can i use this driver for my development purpose or not. If yes does it create any kind of problem in future when i change the platform. My development should not depend on driver and database.
    Can i use any other driver provided by sun microsystem. If yes let me know where can i download and configure it.
    Waiting for the updates ASAP

    See, the bridge, being a type 1 driver has
    river has all the inherent limitations of that type
    drivers, due to the extra levels the data must
    passthrough inthe journey between the DB and the
    client. Also the use of native code.. makes it
    unsuitable to be used in applets.. the odbc should be
    configured in the client for this driver to work. etc.
    etc.
    It may be stable and useful for some
    for some applications.. but for sccenarios where one
    needs the solution tobe platform independent, ...By definition that would be the case. Of course the odbc-bridge does work on Windows, Solaris and Linux. So what other platform were you thinking about?
    ... less dependent on the user configuration,The bridge doesn't need any configuration. Or at least not any more than any other driver. The ODBC driver of course does need configuration.
    ...needs the minimum preparations from theuser, and above all give
    the fastest response time for him, the bridge cannot
    beat type 4 drivers. You are going to have to provide a link for that particular performance quote. Given that performance is impact most severely by requirements then design and finally by round trip time to the database I doubt that for applications (rather than benchmarks) that any difference is going to be significant.
    the problem i think was my use of
    my use of 'commercial' that u pointed out..
    anyway.. u are of course right if what u intended was
    stability only. but what i intended with that word was
    different .. sorry for creating the confusion.
    And it still seems like you are implying that it is not suitable for deployment in production systems. And as I pointed out I did deploy it in a large scale production system.
    I am not saying that type 4 drivers do not have a place nor that they do not have advantages, but their mere existance does not prove that they are a better choice for all installations.

  • Where can I find a sql server 2000 driver which supports JDBC 2.0?

    Where can I find a sql server 2000 driver which supports JDBC 2.0?
    Thanks!
    Paul.

    Here is another.
    http://www.datadirect-technologies.com/download/downloadindex.asp
    The JDBC 3.0 driver will work in a JDBC 2.0 environment (i.e with J2SE 1.2 or 1.3)
    provided you use only JDBC 2.0 features of the driver
    "Sree Bodapati" <[email protected]> wrote:
    >
    >
    http://msdn.microsoft.com/downloads/default.asp?URL=/downloads/sample.asp?ur
    l=/msdn-files/027/001/779/msdncompositedoc.xml&FinishURL=%2Fdownloads%2Frele
    ase%2Easp%3FReleaseID%3D38312%26area%3Dsearch%26ordinal%3D1%26redirect%3Dno
    Microsoft.com downloads :)
    http://www.inetsoftware.de/English/Produkte/JDBC_Overview/ms.htm
    www.inetsoftware.de
    are a couple.
    sree
    "pronane" <[email protected]> wrote in message
    news:[email protected]..
    Where can I find a sql server 2000 driver which supports JDBC 2.0?
    Thanks!
    Paul.

  • Problem of loading the MS SQL Server 2000 driver for JDBC

    Thanks for your reply.
    I have already tried to give the full class path of .jar files to the System and User Variables but received the same error. I am doing BCA and developing my very first Project on Java.
    Please, tell me one thing. When I had installed MS SQL Server 2000 at my system first time then the 3 JAR files were present in the lib folder and all my codings of connectivity were working properly. Then due to some reasons, I had to format C drive and installed the MS SQL Server 2000 again then in the lib folder the 3 JAR files were not there. How it has happened? Then, I installed the downloaded driver of MS SQL Server 2000 for JDBC 1.4 then the JAR files were installed in the related downloaded driver folder. I manually copied them to the lib folder of MS SQL Server and gave that path to the Classpath of System and User Variables, but it didn't work.
    I am not understanding the reason that The Software which worked previously is not working correctly in second time of installing.
    I am using command line to develop my stand-alone project. Please help me.

    Don't bother with the System CLASSPATH, more often than not, it is not even used.
    When running from an IDE, set the project's library preferences.
    When running from a web container/application server configure the applications libraries in the server/container, see it's documentation.
    When running an applet, configure the [ codebase and/or archive |http://java.sun.com/docs/books/tutorial/deployment/applet/html.html] tags properly.
    When running from the command line with the [ "-cp" |http://java.sun.com/javase/6/docs/technotes/tools/solaris/java.html] option, the System CLASSPATH is ignored.
    When running from the command line with the "-jar" option, both the System CLASSPATH path and the "-cp" option are ignored, configure the [manifest file|http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html] properly.
    When running any other way, the System CLASSPATH might be used.

  • Problem of loading the MS SQL Server 2000 Driver for JDBC 1.4.1

    Thanks for your reply.
    I have already tried to give the full class path of .jar files to the System and User Variables but received the same error. I am doing BCA and developing my very first Project on Java.
    Please, tell me one thing. When I had installed MS SQL Server 2000 at my system first time then the 3 JAR files were present in the lib folder and all my codings of connectivity were working properly. Then due to some reasons, I had to format C drive and installed the MS SQL Server 2000 again then in the lib folder the 3 JAR files were not there. How it has happened? Then, I installed the downloaded driver of MS SQL Server 2000 for JDBC 1.4 then the JAR files were installed in the related downloaded driver folder. I manually copied them to the lib folder of MS SQL Server and gave that path to the Classpath of System and User Variables, but it didn't work.
    I am not understanding the reason that The Software which worked previously is not working correctly in second time of installing.
    I am using command line to develop my stand-alone project. Please help me.

    Don't bother with the System CLASSPATH, more often than not, it is not even used.
    When running from an IDE, set the project's library preferences.
    When running from a web container/application server configure the applications libraries in the server/container, see it's documentation.
    When running an applet, configure the [ codebase and/or archive |http://java.sun.com/docs/books/tutorial/deployment/applet/html.html] tags properly.
    When running from the command line with the [ "-cp" |http://java.sun.com/javase/6/docs/technotes/tools/solaris/java.html] option, the System CLASSPATH is ignored.
    When running from the command line with the "-jar" option, both the System CLASSPATH path and the "-cp" option are ignored, configure the [manifest file|http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html] properly.
    When running any other way, the System CLASSPATH might be used.

  • Sql server 2000 driver problem!!! Help

    sql server driver problem
    hi...i want to install sql server 2000 into my IDE Jbuilder 8 Enterprise Edition
    i have follow the instruction that i make a config file by using enterprise setup tool, database driver in Jbuilder and location select <Jbuilder>
    i added new library included the 3 jar file (mssql.jar,msbase.jar and msutil.jar) and made a config file call sqlLib
    after that i go to project|project properties
    at the path page select required library and add the library file that i generated (sqllib)
    i added database component in my java page and setup the properties for the connection
    driver:com.microsoft.jdbc.sqlserver.SqlServerDriver
    URL :jdbc:microsoft:sqlserver://PS:1433
    Username=sa
    passworld:melody
    but when i run the test connection button..it come out this error
    The driver: com.microsoft.jdbc.sqlserver.SqlServerDriver could not be loaded. This could be a problem with the driver itself, or that the driver is not found on the classpath.
    details:
    See com.borland.dx.dataset.DataSetException error code: BASE+82
    com.borland.dx.dataset.DataSetException: The driver: com.microsoft.jdbc.sqlserver.SqlServerDriver could not be loaded. This could be a problem with the driver itself, or that the driver is not found on the classpath.
         at com.borland.dx.dataset.DataSetException.a(Unknown Source)
         at com.borland.dx.dataset.DataSetException.driverNotLoadedInDesign(Unknown Source)
         at com.borland.dx.sql.dataset.Database.addDriver(Unknown Source)
         at com.borland.dx.sql.dataset.Database.addDrivers(Unknown Source)
         at com.borland.dx.sql.dataset.Database.openConnection(Unknown Source)
         at com.borland.jbuilder.cmt.editors.l.c(Unknown Source)
         at com.borland.jbuilder.cmt.editors.l.actionPerformed(Unknown Source)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
         at java.awt.Component.processMouseEvent(Component.java:5093)
         at java.awt.Component.processEvent(Component.java:4890)
         at java.awt.Container.processEvent(Container.java:1566)
         at java.awt.Component.dispatchEventImpl(Component.java:3598)
         at java.awt.Container.dispatchEventImpl(Container.java:1623)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
         at java.awt.Container.dispatchEventImpl(Container.java:1609)
         at java.awt.Window.dispatchEventImpl(Window.java:1585)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:140)
         at java.awt.Dialog.show(Dialog.java:538)
         at com.borland.jbuilder.designer.ButtonDialog.show(Unknown Source)
         at java.awt.Component.show(Component.java:1134)
         at java.awt.Component.setVisible(Component.java:1089)
         at com.borland.jbuilder.designer.inspector.PropertyValueOutEditor.openEdit(Unknown Source)
         at com.borland.jbuilder.designer.inspector.i.actionPerformed(Unknown Source)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:227)
         at java.awt.Component.processMouseEvent(Component.java:5093)
         at java.awt.Component.processEvent(Component.java:4890)
         at java.awt.Container.processEvent(Container.java:1566)
         at java.awt.Component.dispatchEventImpl(Component.java:3598)
         at java.awt.Container.dispatchEventImpl(Container.java:1623)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.repostEvent(BasicTableUI.java:475)
         at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mouseReleased(BasicTableUI.java:532)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:228)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:227)
         at java.awt.Component.processMouseEvent(Component.java:5093)
         at java.awt.Component.processEvent(Component.java:4890)
         at java.awt.Container.processEvent(Container.java:1566)
         at java.awt.Component.dispatchEventImpl(Component.java:3598)
         at java.awt.Container.dispatchEventImpl(Container.java:1623)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
         at java.awt.Container.dispatchEventImpl(Container.java:1609)
         at java.awt.Window.dispatchEventImpl(Window.java:1585)
         at java.awt.Component.dispatchEvent(Component.java:3439)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    i also try added the 3 jar file in lib/ext and jre/lib/ext..
    same condition...:(

    Make a simple program that just does a Class.forName("theDriverName");
    to eliminate all the fancy stuff from jBuilder.
    When you've got the simple things working you can move on.
    Rgds.

  • SQL Server 2000 Driver for JDBC

    I am trying to learn how to connect to SQL Server 2000 and I keep getting errors. I have set my classpath and read through the online books, but I can't fix it. I'm not sure if I'm missing something in the configuration, or at the database level. Here are the errors I'm getting followed by my code: By the way, is there a limit on how long the classpath can be?
    C:\j2sdkP>java TableMaker
    Exception in thread "main" java.lang.NoClassDefFoundError: com/microsoft/jdbc/ba
    se/BaseDriver
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    3)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:130)
    at TableMaker.registerDriver(TableMaker.java:34)
    at TableMaker.<init>(TableMaker.java:22)
    at TableMaker.main(TableMaker.java:77)
    import java.sql.*;
    import sun.jdbc.odbc.JdbcOdbcDriver;
    public class TableMaker
    static String jdbcDriver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    static String dbName = "Contacts";
    static String SQLCreate =
         "Create Table Contact_Info (" +
         "Contact_ID     Integer          Not null     Primary Key, " +
         "First_Name     Varchar(20)     Not null," +
         "MI          Char(1)          Null," +
         "Last_Name     Varchar(30)     Not null," +
         "Street          varchar(50)     Not null," +
         "City          varchar(30)     Not null," +
         "State          Char(2)          Not null," +
         "Zip          varchar(10)     Not null," +
    public TableMaker()
    registerDriver();
    public void setDatabaseName( String dbName )
    this.dbName=dbName;
    public void registerDriver()
    try {
    Class.forName( jdbcDriver );
    catch ( ClassNotFoundException e ){
    System.err.println(e.getMessage());
    public void execute( String SQLCommand )
    Connection con = null;
    Statement stmt = null;
    try {
    con = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433","test","test"); // test is both login and password
    stmt = con.createStatement();
    stmt.execute(SQLCommand);
    con.close();
    catch(Exception e) {
    System.err.println(e.getMessage());
    finally {
    try {
    if (con != null)
         con.close();
         if (stmt != null)
         stmt.close();
    catch (Exception ex) { }
    public static void main(String[] args)
    TableMaker tableMaker = new TableMaker();
    tableMaker.execute(SQLCreate);
    }

    Finally, I fix the problem! Can't put white space after ";" for CLASSPATH!!! for instance classpath=.; c:\..\*.jar doesn't work! it must be classpath=.;c:\..\*.jar The stupid JAVA!!! Thanks a lot.
    I have another problem, right now I can connect to SQL Server 2000 from standalone program, but I can't connect to my DB from servlet.
    ie. the following codes works for standalone program. but it doesn't work for servlet. Any help will be appreciated!
    // Make sure the JdbcOdbcDriver class is loaded
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    // Try to connect to a database via ODBC
    conn = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://127.0.01:1433", "sa","");

  • JDBC - MS SQL Server 2000 Driver

    Do you need to have J2EE to run the MS downloaded SQL Server 2000 JDBC Driver? Currently have the J2SE installed with JDK 1.31_01 installed and keep getting errors where doesn't recognize a number of class objects. -- Thanks

    Do you need to have J2EE to run the MS downloaded SQL
    Server 2000 JDBC Driver? Currently have the J2SE
    installed with JDK 1.31_01 installed and keep getting
    errors where doesn't recognize a number of class
    objects. -- ThanksI did not have any problems on windows 2000 with SQL 7, J2SE 1.4 Beta 3. BUT You will have to re-jar the files since there is a corrupted jar file in their driver. This corruption is not fatal, but causes exceptions to be loggued.
    Did you load the driver with Class.forName ?

  • Problem in SQL Server 2000 Driver for Java Database Connectivity

    Hi,
    I have problem with MS SQL 2000 JDBC driver. I am using Type-4 driver for my application. I can able to connect through DSN. If I use Type-4 Driver to connect database means it gives the following exception.
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
         at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
         at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
         at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
         at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
         at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at test.TestDB.main(TestDB.java:17)
    My Java Code :
    String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    Class.forName(driver);
    Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://192.168.48.90:1433;User=sa;Password=sa;DatabaseName=GWCANADA");
    Statement st = con.createStatement();
    ResultSet rs = st.executeQuery("select * from emp");Do we have any other jdbc driver to connect MS SQL 2000 aprt from the Microsoft JDBC driver.
    Plese help me to resolve this problem
    Thanks
    ---Suresh

    Same problem is here: http://forum.java.sun.com/thread.jspa?threadID=419214&tstart=135
    Check that your server is running (telnet <hostname> 1433)
    --Xapp                                                                                                                                                                                                                                                                                                                   

  • Sql server 2000 driver and windows 98

    i know that this has been discussed many times but i cant find an answer to my problem. was hoping someone could shed some light on it.
    getting the error:
    classnotfoundException: com.microsoft.jdbc.sqlserver.sqlserverdriver
    ive set the classpath and the path.
    set PATH = %PATH%;C:\CIMAGE\IMASTER;C:\ORAWIN95\BIN;C:\Novell\Client32;C:\Progra~1\Mts;C:\J2SDK1~1.1_0\BIN;
    set CLASSPATH = C:\Progra~1\mssqls~1\lib\msbase.jar;C:\Progra~1\mssqls~1\lib\msutil.jar;C:\Progra~1\mssqls~1\lib\mssqls~1.jar;C:\J2SDK1~1.1_0\lib;C:\javaTest;     
    code snipet:
    public void makeConnections(){
    try{
    String DB_DRIVER= "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    StringDB_URL= "jdbc:microsoft:sqlserver://myMachine:1433";
         String username = "sa";
         String password = "password";
         Class.forName(DB_DRIVER);
         con = DriverManager.getConnection(DB_URL,username,password);
         System.out.println("Connection with DB ..........OK");
    catch(SQLException ex) {
         System.err.println("SQLException: " + ex.getMessage());
    catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    am i missing anything?
    when i downloaded the driver it didnt state that windows 98 was supported, i was wondering if this was the problem.
    need help
    thanks.

    never mind, figured it out.

Maybe you are looking for

  • ITunes 7.0.2 freezes a few seconds after I open it

    Every time I open my iTunes, it works fine for about 2-3 seconds (enough time for me to go to my music library or to connect to the iTunes store) and then it completely freezes. Nothing looks different on the screen, but I can't scroll, play any musi

  • Why is the artwork in my movie library wrong?

    The wrong artwork is showing up in iTunes for many (not all) of my movies.  The artwork shows up fine on other devices that access my library (iPad, iPhone, AppleTV) but not in iTunes itself.  Is there anything I can do to correct this?

  • Pb caracters in pdf with JRC 12.2

    Hi ! We use last JRC (12.2.200.454) to generate pdf on MVS Websphere from reports create with Crystal Reports 11.0.0.1282. We placed the fonts in lib/fonts directory of the Java JRE (Times news roman, wingdings ...) but still have problem with some a

  • Does siri is application or a hardware ?

    does siri is application or a hardware ?

  • Update now ipod useless

    Updated my itunes and ipod, was told to plug into wall adapter for changes to take effect so i did. now the screen will only show me a picture of the charger going into the wall or the apple when i turn it off and on. Worked fine before update so tri