Null connection when trying to connect to SQL Server 2000 in Tomcat4.1.29

Hi All,
I am still struggling with null connection when trying to connect to sql server 2000 with tomcat using sun.jdbc.odbc.JdbcOdbcDriver
Here is my server.xml
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
<Resource auth="Container" description="Users and Groups
Database" name="UserDatabase"
scope="Shareable"
type="org.apache.catalina.UserDatabase"/>
<Resource name="jdbc/DefaultDS" scope="Shareable"
type="javax.sql.DataSource"/>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.
MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
<ResourceParams name="jdbc/DefaultDS">
<parameter>
<name>validationQuery</name>
<value></value>
</parameter>
<parameter>
<name>user</name>
<value>sa</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>4</value>
</parameter>
<parameter>
<name>password</name>
<value>sa</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:odbc:JBoss-SQL://localhost:1433;databaseName=Development;selectMethod=cursor;</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>sun.jdbc.odbc.JdbcOdbcDriver</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>2</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Tomcat-Standalone">
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="100" debug="0" connectionTimeout="20000"
useURIValidationHack="false" disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to -1 -->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8443" minProcessors="5" maxProcessors="75"
enableLookups="true"
acceptCount="100" debug="0" scheme="https" secure="true"
useURIValidationHack="false" disableUploadTimeout="true">
<Factory className="org.apache.coyote.tomcat4.CoyoteServerSocketFactory"
clientAuth="false" protocol="TLS" />
</Connector>
-->
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="0"
useURIValidationHack="false"
protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
<!-- Define an AJP 1.3 Connector on port 8009 --><Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Define the default virtual host -->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<Environment name="maxExemptions" type="java.lang.Integer"
value="15"/>
<Parameter name="context.param.name" value="context.param.value"
override="false"/>
<Resource name="jdbc/DefaultDS" auth="container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/DefaultDS">
<!-- Maximum number of dB connections in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>8</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>4</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<!-- MS Sql Server dB username and password for dB connections
-->
<parameter>
<name>user</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value>sa</value>
</parameter>
<!-- Class name for MS Sql Server JDBC driver
-->
<parameter>
<name>driverClassName</name>
<value>sun.jdbc.odbc.JdbcOdbcDriver</value>
</parameter>
<!-- The JDBC connection url for connecting to MS Sql Server dB.
-->
<parameter>
<name>url</name>
<value>jdbc:odbc:JBoss-SQL://localhost:1433;databaseName=Development;selectMethod=cursor;</value>
</parameter>
<!-- This Databae Connection Pool Description.
-->
<parameter>
<name>description</name>
<value>JDBC Driver: sun.jdbc.odbc.JdbcOdbcDriver</value>
</parameter>
</ResourceParams>
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>localhost</value>
</parameter>
</ResourceParams>
<ResourceLink name="linkToGlobalResource"
global="simpleValue"
type="java.lang.Integer"/>
</Host>
</Engine>
</Service>
</Server>
and my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<!-- Standard Action Servlet Mapping -->
<web-app>
<resource-ref>
<res-ref-name>jdbc/DefaultDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
and JBoss-SQL is data source I created from control panel settings and here is way I am retrieving connetion
InitialContext initCtx = new InitialContext();
DataSource ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/DefaultDS");
Connection con = ds.getConnection();
return con;
I tried connecting as mentioned in this website
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html#Common%20Problems.But didn't help
Please help urgent
Sorry for long file. Can any one please help me in solving this problem.
Thanks in advnace
Kurakula

I'd recommend that you not use the JDBC-ODBC bridge driver to connect to SQL Server. M$ and jTDS are two free type IV JDBC drivers that you should use instead. Put those JARs in the WEB-INF/lib directory.
The database URL you're using is not correct if you change drivers. Consult the docs to find out what the proper syntax is.
MOD

Similar Messages

  • Anyone successfully set up connection pool in s1as with ms sql server 2000?

    As subject. Since I have seen a lot of posts about the NoSuchMethodException issue with various dbms providers, and the only "official information" I found thru different forums, google, different sun/javasoft sites and forums are this:
    http://sunsolve.sun.com/pub-cgi/retrieve.pl?doc=fsunone%2F8172&zone_32=NoSuchMethodException&wholewords=on
    Which is wonderfully vague and provide not-so-much useful information...
    As for the information and suggestion posted by other forum members, most or all of them have experience with setting up Oracle, DB2, mySQL, etc., not aimed for MS SQL Server 2000 (you may think, I am just asking for it running MS SQL server with Java... oh well, not my choice)
    I still haven't seen any positive feedbacks on how this exception was caused and how to resolve it. I have literally exhausted all leads on how to fix this issue, so right now I'm only interested to know whether anyone in the forum actually have a successful connection pool set up with MS SQL server 2000.
    My platform:
    w2k sp3
    SunOne app server, update1, JDK 1.4.1
    latest MS SQL 2000 JDBC driver
    This fails with the NoSuchMethodException error:
    try {
    InitialContext ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("test_db");
    con = ds.getConnection();
    System.out.println( "con is created -> " + con );
    } catch (Exception ex) {
    System.out.println( "failed -> " + ex.getMessage() );
    This works just fine:
    try {
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    con = DriverManager.getConnection("jdbc:microsoft:sqlserver://xxx.xxx.xxx.xxx:1433;DatabaseName=testdb;SelectMethod=cursor", "username", "password");
    System.out.println( "con is created -> " + con );
    } catch (Exception ex) {
    System.out.println( "failed is fucked -> " + ex.getMessage() );
    thanks,
    --kuan

    Hi,
    Thanks for pointing out that article, I did not find it previously. After following the directions in the artile and your advise, now dbping seems to be able to connect to SQL server.
    Thank you very much.
    --kuan                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Connect webdynpro callable object with ms sql server 2000

    Hi all
    how connect webdynpro callable object with ms sql server 2000?
    How can I register on the portal as an additional connection?
    thank you very much!

    Thanks for your answers, Now I have the following problem, to develop this code:
    try {
              InitialContext iC = new InitialContext();
              DataSource dataSource = (DataSource)iC.lookup("jdbc/ConnectionAlias");
              Connection con = dataSource.getConnection();
              java.sql.Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("select * from ejemplo");
              while (rs.next()){
                   com.sap.test.sql.testsql.wdp.IPrivateTestIViewView.IDatosElement
                                                             DatosElement =
                                                             wdContext.nodeDatos()
                                                             .createDatosElement();
                   DatosElement.setId(rs.getString("id"));
                   DatosElement.setNom(rs.getString("nom"));
                   DatosElement.setNum(rs.getInt("num"));
         }catch (SQLException e) {
              wdContext.currentContextElement().setB(e.getMessage());
         }catch (Exception e){
              wdContext.currentContextElement().setB(e.getMessage());
    and shows me the following exception
    ResourceException in method ConnectionFactoryImpl.getConnection(): com.sap.engine.services.dbpool.exceptions.BaseResourceException: SQLException thrown by the physical connection: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    the data that you place in the visual administrator were:
    Drivers: com.sap.aii.af.jmsproviderlib (msutil.jar , mssqlserver.jar , msbase.jar)
    DataSources: sap.com/JDBCConnector_MyDatasource.xml
                   Name: MyDatasource
                   Alias: ConnectionAlias
                   DriverName: com.sap.aii.af.jmsproviderlib
                   JDBC Version: 1.x
                   Driver Class: com.microsoft.jdbc.sqlserver.SQLServerDriver
                   Database URL: jdbc:microsoft:sqlserver://181.42.101.219:1433;DatabaseName=test
                   User: sa
                   Password: abcd1234
    did not know the cause of the problem
    thanks!

  • I get a msg"failed connection" when trying to connect Sony dvd/Blu-ray player to tv

    I have had problems with picture quality on tv. I think it is my very old dvd/vid player, so bought a Sony dvd/Blu-ray player. I continually get a failed connection msg when trying to set it up and connect to the tv.  Have dbl checked all cables etc, and all has been done according to manual.??  Any thoughts appreciated! 

    Hello Wendyd, thank you for your message. Welcome to SONY Community!
    Error: Physical Connection Failed
    Follow the steps below to resolve this error message:
    Make sure the Ethernet cable is securely connected to both the Sony product and the router or modem.
    If the Sony product still does not detect the router or modem, try connecting the Ethernet cable to a different LAN jack (if available) on the router or modem .
    If still no connection is detected, try replacing the Ethernet cable.
    NOTE: The Ethernet cable can be tested by unplugging it from the Sony product and connecting it to the LAN jack on a computer. After turning off any Wi-Fi® option on the computer, try using the computer to access the Internet through the Ethernet connection. If the Internet cannot be accessed, the cable should be replaced.
    For further assistance regarding your concern, please contact the Sony offices/Sony representative offices nearest to your place of residence in Asia Pacific region http://www.sony-asia.com/countryselector.html?hpid=countryselector:AsiaPacific. 
    Due to proximity, they are in a better position to respond to your questions or concerns.

  • RE:ora-28500 when trying to insert into SQL Server table

    Hi all!
    I'm getting this when i attempt to insert into my table test in a SQL Server database. As u can see from the select, the database link seems ok. Any ideas plz. Thnx..
    SQL> select "idAges" from test@try2;
    no rows selected
    SQL> insert into test@try2 ("idAges","nARAges","nAPAges") values(10,'','');
    insert into test@try2 ("idAges","nARAges","nAPAges") values(10,'','')
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver][SQL
    Server]Cannot insert explicit value for identity column in table 'test' when
    IDENTITY_INSERT is set to OFF. (SQL State: 23000; SQL Code: 544)
    ORA-02063: preceding 2 lines from TRY2

    IDENTITY_INSERT on works only for particular session and for one table. It's not global variable.
    The only idea what I have is to create link from MS Sql to Oracle (right now You have oracle ->ms sql)and then before insert You will set identity_insert on and will run insert.

  • Simple way to connect Oracle 11g XE with MS SQL Server 2000

    Is there a simple way to access SQL server database/ Tables within from Oracle 11g XE (Windows-32bit) on same machine. I am a novice so kindly keep it simple. Thanks

    To connect to a SQL Server you need to use an Oracle product called Database gateway for ODBC which uses a 3rd party ODBC driver to connect to the SQL Server.
    The easiest set up is to install DG4ODBC release 11.2 on the SQL Server. How to configure the Database Gateway for ODBC is described in note:
    How to Configure DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit to Connect to Non-Oracle Databases Post Install          [Document 466225.1]     
    when you install DG4ODBC on a 32bit Windows operating system and the instructions for a 64bit Widnows operating system can be found in this note:
    How to Configure DG4ODBC (Oracle Database Gateway for ODBC) on 64bit Windows Operating Systems to Connect to Non-Oracle Databases Post Install          [Document 1266572.1]     
    The database gateway for ODBC is available for free from here:
    http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
    Please make sure you select the 32bit or 64bit Windows operating system depending on the platform where you've installed the SQL Server and on which you now install the gateway and download the <win32/64>_11gR2_gateways.zip CD.
    Once downloaded, unzip it and install it using the Oracle Universal installer. Make sure you select the product Database Gateway for ODBC (there's also a dedicated SQL server gateway called Database Gateway for MS SQL Server - this gateway is NOT for free and it requires a separate license).

  • Connecting to an SQL Server 2000 Database

    Hi!
    I am trying to make a connection to a database created from SQL Server 2000. However, I don't know how to do it. Can anyone please help? How would the Java code different from the code we use to connect to a database created from MS Access?
    jt

    Hi Hartmut,
    I have a program which inserts a date into a table.
    I use a dsn configured to a database (as you've
    suggested). In my case, it's MS Access:
    private boolean writeToMSAccess(Hashtable ht) {
        // Build sql statement;
        // we use of # around the date, for MS Access.
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "#" + date + "#, " +
            .... + "')";
            // Connect to the database, execute the sql.
            // dsn is passed into the program
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String url = "jdbc:odbc:" + dsn;
            Connection conn = DriverManager.getConnection(url, login, password);
            Statement  stmt = conn.createStatement();
            stmt.executeUpdate(sql);
            stmt.close();
            conn.close();
            return true;
        }Now if I point my DSN to SQL Server for example,
    it won't work b/c of the # marks. I'd have to change:
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "#" + date + "#, " +
            .... + "')";to:
        String sql =
            "INSERT INTO Broadcast (Author, BroadcastTime, Title, Length, BroadcastGroup,Link) " +
            "VALUES ('" + (String)ht.get("author") + "', " +
            "'" + date + "', " +
            .... + "')";My question is, is there a way to detect which database
    my dsn points to, so that I can determine at run-time
    whether or not to use the # marks?
    Or is there another way around this problem?
    Any help is greatly appreciated!
    -alex

  • Connection with SQL Server 2000 to SQL Developer 1.2 Migration Workbench

    Hi all,
    I keep getting the following error with setup for SQL Developer 1.2 Migration Workbench connection to SQL Server 2000 database:
    "Status: Failure -Network error IOException: Connection refused:connect"
    I can access the Microsoft SQL Server 2000 database with username
    and password using Enteprise Manager. However for some odd
    reason the Oracle SQL Developer 1.2 cannot connect to it.

    I was having this problem too. I'll mangle this explanation, but Our SQLServer instance was on a local server with some named DNS something. So, to get to the server, we used theservername.outdomain instead of an IP. We could never get it to connect through the named server. We got an SQLServer instance going on a server that we could connect to through a regular IP, and it connected just fine.
    Also, are you using the JTDS driver, or microsofts driver? We have only been able to connect with the JTDS driver. http://jtds.sourceforge.net/

  • Connecting to SQL Server 2000 from Oracle 9iDS

    hi
    I want to connect Forms Developer 9i to a SQL Server 2000 Database for integration purposes. Mentioning that I don't have any Oracle servers on my system.
    Thanks

    hi
    I want to connect Forms Developer 9i to a SQL Server 2000 Database for integration purposes. Mentioning that I don't have any Oracle servers on my system.
    Thanks

  • Trying to migrate SQL Server 2000 to Oracle 10g.

    Hi.
    I´m trying to migrate from Sql Server 2000 to Oracle 10g and I got some troubles.
    I have connected both databases with my Oracle Sql Server, after that I went to the Menu--> Migrate--> Fast Migration and then fill all the steps necesary.
    I can see the repository`s table at the oracle schema but after that the Sql Developer hang at the point "capture". I let the tool work for 2 hours and nothing to do. It´s not a hughe db so could be done faster.
    May I miss something?.
    Thanks.

    Hi
    I also have similar issue when trying to migrate from MS SQL 2005 to oracle 10g.
    I use the SQL Developer Version 2.1.0.63.
    First, I tried to use 'Quick Migration' then it created repository then stop there with error message
    "Error ocurred during capture: ORA-01400: cannot insert NULL into ("DDHCOWNER"."MD_PROJECTS"."ID")"
    Then, try manual way to capture SQL server, but some how it doesn't work. It just refresh IDE and stop.
    Before this activity, I tried to migrate MS SQL 2005 using 'Quick Migration' and it works. But this time I have to do it on another DB then this happened.
    So I re-try the previous connection then encountered the same to all.
    Thus, please kindly help to advice how to solve this problem.
    Thank you so much.
    Regards,
    Sai Lin Naung

  • JDBC for Microsoft SQL Server 2000

    Hello,
    I have installed Microsoft SQL Server 2000 to establish a connection with JDK 1.4.1 and run the following code:
    import java.sql.Connection.*;
    import java.sql.*;
    public class Connect
    private java.sql.Connection con = null;
    private final String url = "jdbc:microsoft:sqlserver://";
    private final String serverName= "localhost";
    private final String portNumber = "1433";
    private final String databaseName= "cbi";
    private final String userName = "sa";
    private final String password = "";
    // Informs the driver to use server a side-cursor,
    // which permits more than one active statement
    // on a connection.
    private final String selectMethod = "cursor";
    // Constructor
    public Connect(){}
    private String getConnectionUrl()
    return url+serverName+":"+portNumber+";databaseName="+databaseName+";selectMethod="+selectMethod+";";
    private java.sql.Connection getConnection()
    try
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    con = java.sql.DriverManager.getConnection(getConnectionUrl(),userName,password);
    if(con!=null)
    System.out.println("Connection Successful!");
    catch(Exception e)
    e.printStackTrace();
    System.out.println("Error Trace in getConnection() : " + e.getMessage());
    return con;
    Display the driver properties, database details
    public void displayDbProperties()
    java.sql.DatabaseMetaData dm = null;
    java.sql.ResultSet rs = null;
    try
    con= this.getConnection();
    if(con!=null)
    dm = con.getMetaData();
    System.out.println("Driver Information");
    System.out.println("\tDriver Name: "+ dm.getDriverName());
    System.out.println("\tDriver Version: "+ dm.getDriverVersion ());
    System.out.println("\nDatabase Information ");
    System.out.println("\tDatabase Name: "+ dm.getDatabaseProductName());
    System.out.println("\tDatabase Version: "+ dm.getDatabaseProductVersion());
    System.out.println("Avalilable Catalogs ");
    rs = dm.getCatalogs();
    while(rs.next())
    System.out.println("\tcatalog: "+ rs.getString(1));
    rs.close();
    rs = null;
    closeConnection();
    else
    System.out.println("Error: No active Connection");
    catch(Exception e)
    e.printStackTrace();
    dm=null;
    private void closeConnection()
    try
    if(con!=null)
    con.close();
    con=null;
    catch(Exception e)
    e.printStackTrace();
    public static void main(String[] args) throws Exception
    Connect myDbTest = new Connect();
    myDbTest.displayDbProperties();
    but, I received the error that ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver, No active Connection.
    I added the 3 .jar files msbase.jar,mssqlserver.jar and msutil.jar to the System variables but it is not working. Is there any syntax for adding these .jar files to the System Variables?
    Please, help me and give me the solution for establishing the connection and loading the driver class. If I am doing anything wrong then please, tell me the right step.
    I am developing a project on Java and I have very little time left to accomplish it. Please help me.
    Thankyou.

    I had already given the .jar files to the User variables and System Variables but the driver class is still not loading. I had simply given the .jar file name for instance, msbase.jar;mssqlserver.jar;msutil.jar and also tried the path of .jar files i.e., C:\Microsoft SQL Server\-----------\lib\msbase.jar;C:\-------------lib\mssqlserver.jar;C:\----------------\lib\msutil.jar; but, both ways are not working. When I installed the MS SQL Server 2000 then in the lib folder, the 3 JAR files were not installed then, I downloaded a driver for MS SQL Server 2000 Driver for JDBC sp2, then, the JAR files were installed. Then, I copied those files to the lib folder of MS SQL Server and gave that path to the User and System Variables but it didn't work then I gave the original path of files where they are installed i.e., of the Driver's path which I downloaded from Microsoft but still now, my problem is not solved. Please help me.

  • Problem of loading the Driver of MS SQL Server 2000

    Is there anyone in the Sun Forum who will help me?
    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.

    I have really no idea what in earth "the same error" is which you're talking about. Be specific. Post the exception type, message and stacktrace.

  • 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.

  • Intermittent error establishing socket on SQL Server 2000

    I have a suite of 130 JUnit tests. Recently, they started to give me intermittent "error establishing socket" errors when trying to connect to a local instance of SQL Server 2000 via JDBC.
    Each test creates one or more connections. I've used wrappers to prove that I'm closing all of the connections, statements, prepared statements and result sets. The first 70 or 80 tests succeed. After that every test gets the "error establishing socket" exception. Sometimes (but not always) SQL Server continues to refuse connections when I re-run the suite. When that happens I have to let it sit for 30 seconds or so (or restart the server) before it will accept connections.
    I've tested this with both Microsoft's and WebLogic's JDBC drivers with the same results. There's nothing in the SQL Server logs when this happens. There's nothing in the Windows event logs, either.
    If I sleep for 5 seconds between each test the problem goes away.
    I installed the latest service pack (SP3a) for SQL Server 2000 with no change in behavior.
    All of this leads me to believe that something is wrong with SQL Server. Has anyone else run into this problem? Any ideas?

    I am not overly familiar with the SQL Server network architecture, but there are scenarios that could explain your intermittent failures.
    When you connect to a database one of two things can happen, you can start your own process on the server that acts as communication to from the server locally, or you are put in a queue for a static (shared) process that does the same thing.
    Assuming that most databases are initially setup with singular processes per connection, and you have established a connection then you disconnect from the database you do not automatically or instantly kill your process running on the server. There are two primary reasons for this as far as I know. First, the database puts more priority on doing something then doing nothing. Cleaning up and removing your process would be considered doing nothing, accepting incoming connections would be considered doing something. Second, the process may have to stay around to ensure all commit or rollback is completed properly (not always true in every database).
    So, I would expect that there is a connection limit (perhaps between 50-80) that you are exceeding because you are firing these connections rapidly and even though you close the connection in your remote program, the database simply doesn't keep up. Most databases will "cleanup" reasonably quickly if they have the resources to do so, so if you were to put a 30 second delay between every connection it would probably work just fine. It would probably work fine if you put a 30 second delay between after every 20 connections too. It's a bit of balancing act.
    There would be a couple of ways to alleviate this constraint. Putting in delays can demonstrate that this is in fact a work load problem (constrained by total count of connections), but doesn't really help in production instances. You can change the maximum number of connections allowed by the database, however this threshold may be caused by hardware resource (memory) limitations as much as it is a parameter in the database. You may have to add memory to accommodate this many connections. You may have to constrain how much memory each connection gets (again controlled by database parameters). You may have to accept this as a resource constraint and write your code accordingly. This often manifests itself by taking advantage of transaction managers (or transaction manager logic) that will queue up requests until database resources are available.
    Again, I'm not a SQL Server expert, but I'm reasonably certain that most of what I said applies if not specifically at least generally.
    Good Luck.

Maybe you are looking for