JDBC connecting MS SQL Server DB Help!!!

I have some problems with connecting DB in my program.
I read many forms of creation of connectin string and writting programs.
Can anybody help me?
I need an example of writting simple program connecting MS SQL Db with JDBC.

hi neetLynx ,
I am using JSQLConnect Driver for SqlServer 7.0 /2000
Download it and use it
Class.forName("com.jnetdirect.jsql.JSQLDriver");
     Connection con=DriverManager.getConnection("jdbc:JSQLConnect://ajit/database=pubs&user=sa");
     Statement stat=con.createStatement();
ajit is the host name or the name of the local computer in which the database resides,pubs the database name
and if u use a password just continue
("jdbc:JSQLConnect://ajit/database=pubs&user=sa&password= "
rest u know....
thanks
royce

Similar Messages

  • JDBC connection to SQL Server 2000 Service Pack 4

    Hello Everyone,
    I'm trying to do a simple application which save some values into a MS SQL Server 2000 Database's Table.
    The source code I've written is:
    package Logging;
    import com.brekeke.net.sip.sv.session.*;
    import com.brekeke.net.sip.sv.session.plugins.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    public class Logging extends AccountingBase {
    public int eventSessionStart( EventStat evstat, String[] argprm )
    int ris =0;
    int line=999;
    try {
    EventStat a;
    a = evstat ;
    String username;
    username=a.urlCaller;
    String callee;
    callee=a.urlCallee;
    Statement stmt = null;
    try {
    line=1;
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    line=2;
    Connection conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://BSSQL:1433;DataBaseName=Test;User=sa;Password=biesse");
    line=3;
    // Create and execute an SQL statement that returns some data.
    String SQL = "INSERT INTO log VALUES ('" + a.urlCaller + "','" + a.urlCallee + "')";
    line=4;
    stmt = conn.createStatement();
    line=5;
    line=stmt.executeUpdate(SQL);
    line=10;
    catch (Exception e) {
    e.printStackTrace();
    finally {
    if (stmt != null) try { stmt.close(); } catch(Exception e) {}
    File f = new File("c:/prova.txt");
    FileOutputStream fos=new FileOutputStream(f);
    PrintStream ps=new PrintStream(fos);
    ps.println(line);
    ps.println(a.urlCaller);
    ps.println(a.urlCallee);
    fos.close();
    catch ( Exception ex ) {
    return ris;
    The problem is that into the Table no value is written, no problem compiling it and into the file prova.txt I can see only the value line=1 written!
    So there should be something wrong in the connection.
    I've already installed the JDBC drivers for SQL Server 2000 and I've addedd into the libraries the "msbase.jar, the mssqlserver.jar and the msutil.jar".
    But nothjng written into the Database :-(
    Can you help me please?
    Thank you very much in advance,
    Best Regards
    Francesco

    Hi,
    Yes i am able to connect from ISQL. Only connecting from JDBC is a problem.

  • ABAP statement for JDBC connection to SQL server

    Hi Gurus,
    i need to connect a WebDynpro abap to a SQL server.
    My OS is Unix so i cannot use a ODBC connection.
    Can anyone help me to know if it's possible to write an abap statement to connect the SQL server by JDBC connection?
    thanks a lot
    Regards
    Claudio.

    Hi,
          ELSEIF SCREEN-GROUP2 = 'PRO'.
          clear: list.
          if screen-name = 'ZAVBAK-ZZPROMO_ID'.
            exec sql.
       commit
              set connection :'CBREPOSITORYPRD'
            endexec.
            exec sql.
              CONNECT TO :'CBREPOSITORYPRD'
            endexec.
            exec sql.
              COMMIT
            endexec
          EXEC SQL.
              OPEN C1 FOR
              SELECT CutterRewardsUserListid,
                     SAPAccountNumber,
                     PromoID,
                     FirstName,
                     LastName
                     FROM CutterRewardsUserList
                     WHERE SAPAccountNumber = :XVBPA-KUNNR ORDER BY PromoID
            ENDEXEC.
            DO.
              EXEC SQL.
                FETCH NEXT C1 INTO :WA5
              ENDEXEC.
              IF SY-SUBRC = 0.
                PERFORM UPDATE_LIST.
              ELSE.
                EXIT.
              ENDIF.
            ENDDO.
            EXEC SQL.
              CLOSE C1
            ENDEXEC.

  • Some times on Tomcat start up it creates SSL error while JDBC connection to SQL server

    We are using Apache Tomcat 6 and SQL server 2008 on production. In the application in ServletContextListner we make DB connection to read some property from DB. When we restart the Tomcat 6.0 in that case sometimes it does not gets DB connection till 5 to
    10 minutes. It does not happen every time. We are using JNDI for getting the Datasource objectand using SQL JDBC 3.0 driver. We get following error in log
    org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Connection reset by peer: socket write error".)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
    at com.rightwave.util.RWDBConnectionManager.getConnection(RWDBConnectionManager.java:145)
    at com.rightwave.util.RWDataBaseDAO.executeQuery(RWDataBaseDAO.java:306)
    at com.rightwave.util.RWDataBaseDAO.executeQuery(RWDataBaseDAO.java:289)
    at com.rightwave.admin.RWApplicationContext.setMConfigurationProperties(RWApplicationContext.java:226)
    at com.rightwave.admin.RWAdminApplicationContext.initialize(RWAdminApplicationContext.java:85)
    at com.rightwave.admin.RWServletContextListener.contextInitialized(RWServletContextListener.java:186)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "Connection reset by peer: socket write error".
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(SQLServerConnection.java:1368)
    at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1412)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1058)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:833)
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:716)
    at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)
    at org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
    at org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247)
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221)
    ... 31 more
    Caused by: java.io.IOException: Connection reset by peer: socket write error
    at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.ensureSSLPayload(IOBuffer.java:500)
    at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.readInternal(IOBuffer.java:570)
    at com.microsoft.sqlserver.jdbc.TDSChannel$SSLHandshakeInputStream.read(IOBuffer.java:562)
    at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.readInternal(IOBuffer.java:757)
    at com.microsoft.sqlserver.jdbc.TDSChannel$ProxyInputStream.read(IOBuffer.java:745)
    at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)
    at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at com.microsoft.sqlserver.jdbc.TDSChannel.enableSSL(IOBuffer.java:1379)
    ... 39 more
    Urgent help will be appreciated. 

    So, you've got a network error.. Check your physical layer.

  • JDBC connection to SQL Server 2000

    Hi,
    I am new to Java programming. I am using Websphere Studio Site Developer 5.1 and I am having issues connecting to SQL 2000.
    This is what I have done so far:
    1. Downloaded the SQL Server 2k JDBC service pack 3 driver from Microsoft.
    2. Ran the executable. Seems like the JDBC driver was installed successfully.
    3. Created a user w/ dbo permissions on the DB that I want to access.
    Here is a snippet of my java code so far:
    Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://DEV01:1433;DatabaseName=NG_RFQ;SelectMethod=cursor", "username", "password");
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM Customer");
    if(rs.next()){
    customerName = rs.getString("CustomerName");
    buyerName = rs.getString("BuyerName");
    con.close();
    I have been working on this for days and can NOT get a connection established.
    Here are some of the error messages that I have been receiving thru WSSD.
    java.sql.SQLException: No suitable driver
    [8/11/04 18:11:54:815 EDT] 5e5c8f29 SystemErr R      at java.sql.DriverManager.getConnection(DriverManager.java:558)
    Can anyone please tell me what I am doing wrong? Or point me in the right direction.
    I have searched hi and lo for the answer but still no luck.
    Any help would be greatly appreciated.
    Thanks!
    -JML

    "No suitable driver" means one of two things:
    1. You forgot the Class.forName() part (quite uncommon, but if I look at the original post, this might just be the cause).
    2. The URL is wrong (usually a typo, look for colons, semicolons, parameter names etc.)
    Alin.

  • JDBC connection for SQL Server 2000

    How to connect SQL Server 2000 from java?
    If i can get any sites where i can get examples also fine.
    Thanks in advance
    Praveen.

    Developer's Daily  Java Education 
      front page | java | perl | unix | DevDirectory 
      Front Page
    Java
    Education
    Pure Java
       Articles
    JDBC 101: How to connect to an SQL database with JDBC
    Introduction
    If you're interested in connecting your Java applets and applications to standard SQL databases like Oracle, Informix, Sybase, and others, JDBC is your ticket to paradise.  The combination of Java's JDBC and standard SQL makes a simple and powerful database solution. JDBC makes the simple things easy -- without making the complex tasks too difficult either.
    In this first article in our series, we'll show you step-by-step how to establish a connection from your Java programs to an SQL database using JDBC. In the process we'll show you how to connect to two different databases -- Mini SQL (mSQL), and Interbase -- just so you can see how the code changes when you switch from one database to another.
    Obtaining the JDBC driver
    Before you start working with JDBC, you'll need a copy of the Java JDK. If you don't have it already, you can get the JDK for free at Sun's Java web site, or it will also be included with many IDE's that you can purchase, such as JBuilder or Visual Cafe.
    Once you have the JDK, the next thing you need to do is to get the correct JDBC driver for your database. In most cases the JDBC driver will be provided by your database vendor. For instance, if you purchase the Interbase database, the driver will be provided with the software, or you can obtain the most recent version at http://www.interbase.com/.
    (An exception to this rule is Mini SQL, or mSQL. Because it's a very low-cost database, the JDBC driver has actually been developed by a separate group of people, led by George Reese at imaginary.com. You can download the mSQL JDBC driver from the imaginary.com web site.)
    Once you have the correct JDBC driver for your database, install it according to the instructions that came with it. Installation instructions will vary somewhat for each vendor.
    Establishing a connection is a two-step process
    Once you have the correct JDBC driver installed, establishing a connection from your Java programs to your SQL database is pretty easy.
    Regardless of whether you're trying to connect to Oracle, Sybase, Informix, mSQL, or Interbase (or any other JDBC data source), establishing a connection to an SQL database with Java JDBC is a simple two-step process:
    Load the JDBC driver.
    Establish the connection.
    We'll show you two examples just so you can see how easy it is, and how little the code changes when you migrate from one database server to another.
    A Mini SQL Example
    Listing 1 provides the full source code required to establish a connection to a mSQL database on a server named "www.myserver.com".
      //  Establish a connection to a mSQL database using JDBC. 
    import java.sql.*; 
    class JdbcTest1 { 
        public static void main (String[] args) { 
            try { 
                // Step 1: Load the JDBC driver. 
                Class.forName("com.imaginary.sql.msql.MsqlDriver"); 
                // Step 2: Establish the connection to the database. 
                String url = "jdbc:msql://www.myserver.com:1114/contact_mgr"; 
                Connection conn = DriverManager.getConnection(url,"user1","password");  
            } catch (Exception e) { 
                System.err.println("Got an exception! "); 
                System.err.println(e.getMessage()); 
      Listing 1: This source code example shows the two steps required to establish a connection to a Mini SQL (mSQL) database using JDBC. 
    An Interbase Example
    Listing 2 provides the full source code required to establish a connection to an Interbase database. In this example, we're connecting to a local Interbase server (i.e., the server is running on the same PC that we're running the Java code on).
      //  Establish a connection to an Interbase database using JDBC. 
    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:contact_mgr"; 
                Connection conn = DriverManager.getConnection(url,"user1","password");  
            } catch (Exception e) { 
                System.err.println("Got an exception! "); 
                System.err.println(e.getMessage()); 
      Listing 2: This source code example shows the two steps required to establish a connection to an Interbase database using JDBC. 
    What's the difference?
    The difference between the two source code listings is very small, so we highlighted them in a dark blue color. The only difference between connecting to the two databases is:
    The name of the JDBC driver.
    The URL used to connect to the database.
    Everything else in the two source code listings -- except for the comment at the top -- is identical. Here's a slightly more detailed discussion of the two differences:
    1. The JDBC Driver
    The name of the JDBC driver will be supplied to you by your database vendor. As you can see in the class.forName() statements, these names will vary. In the first case we're using the mSQL-JDBC driver. In the second case we're using the JDBC-ODBC Bridge driver supplied with the Interbase server.
    2. The URL
    The syntax of the DriverManager.getConnection() method is:
    DriverManager.getConnection(String url, String username, String password);
    The username and password are the normal names you use to log into your database. The URL you use will again vary with the database you use. In both examples shown, we're establishing a connection to a database named contact_mgr. (We'll use this database for all of our examples in this series of JDBC articles.)
    If you stick with standard SQL commands, it can be very easy to switch from one database server to another. In fact, I've heard from several developers who are using mSQL to prototype their software (because it's so inexpensive), and then switching to another commercial vendor when it's time to take their product "live".
    Conclusion
    Establishing a connection to an SQL database with Java JDBC is a simple, two-step process. The process is nearly identical for all SQL databases, and the only real differences are (a) the driver name, and (b) the URL used to connect to the database. Your database vendor will provide this information in their documentation.
    Resources mentioned in this article
    Here are a few links to resources we mentioned in this article:
    Interbase
    The Mini SQL (mSQL) database
    The mSQL-JDBC driver at imaginary.com
      [an error occurred while processing this directive]
     

  • JDBC Connectivity for SQL Server 2005 Windows Authentication Mode

    Hi Everyone,
    In my Scenario we are using SQL Server 2005 with Mixed Mode Authentication. Now we are planning to move only with Windows Authentication Mode.
    We have configured DB with Window authentication mode & user id have been configured in PI channels however we are getting error. We checked microsoft site, which says Windows Authentication mode DB can not be connected using JDBC drivers.
    http://support.microsoft.com/kb/313100
    In this above link see Basic Connectivity Troubleshooting Section.
    Please let me know if someone confirued JDBC Channel Successfuly with Windows Authentication Mode.
    Thanks In Advance
    Regards,
    Bharathi.

    I think this issue is related to the way that Vista, Windows 7 and Windows 2008 / 2008 R2 treat users who are logged on to the system with an account that is a member of the local administrators group when SQL is running locally.
    If your SQL setup has left you with BUILTIN\Administrators being a member of the sysadmin server role and you start up SQL Management Studio you'd expect to be mapped to the sysadmin role if your user account is in the local administrators group, however
    these OS disable this ability and when you try to connect to the database engine SQL server doesn't know you are a member of the local administrators group.
    To get round this, close all your open SQL management studio windows and then start a new window by right clicking the icon in the start menu and chosing to run as administrator. This time when you try to connect to the SQL database engine, windows doesn't
    "hide" the fact that you are an administrator. If you need to do this a lot you can go to the compatibility tab on the properties of the shortcut and set it to always run as administrator.
    Alternatively you can install the admin tools remotely and you don't get this effect.
    Tim

  • Problem in jdbc connection to sql server

    I hv some problem in connection. i am not sure hv to use this line of code. My server name is YC\YC and i m using window autentic usr name and passwd. How to i solve the problem? Thanks!
    Connection connection = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://<Host>:1433",<"UID>","<PWD>");

    Is it means that add a new user?
    Now i add a new user name "boon" passwd "abc123"
    SQL service manager there state my server running is YC\YC, is it that one my server name and instance?
    Connection connection = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://YC\\YC:1433", "boon", "abc123");

  • Jdeveloper connecting with SQL Server Express

    Hi i am trying to connect jdeveloper with SQL Server Express. At the moment i am getting a TCP/IP connection to the host error message.
    My connection string is as follows:
    Class.forName("com.micorosoft.sqlserver.jdbc.SQLServerDriver")
    Connection conn = DriverManager.getConnection("jdbc:sqlserver://mustang/sqlexpress; database = matt1; Uid = matt; Pwd = matt1")
    Can someone please help me!

    Enable TCP/IP protocol. Select Microsoft SQL Server 2005>Configuration Tools>SQL Server Configuration Manager. In the SQL Server Configuration Manager select the node SQL Server 2005 Network Configuration>Protocols for SQLEXPRESS. Right-click on the TCP/IP node and select Enable. Restart the SQL Server (SQLEXPRESS) service. In Adminstrative Tools>Services, right-click on the SQL Server (SQLEXPRESS) service and select Restart.
    To configure a JDBC connection with SQL Server 2005 Express, add SQL Server 2005 JDBC driver JAR file <Microsoft SQL Server 2005 JDBC Driver>/sqljdbc_1.0/enu/sqljdbc.jar to classpath. <Microsoft SQL Server 2005 JDBC Driver> is the directory in which SQL Server 2005 JDBC Driver zip file is installed.
    Driver class for SQL Server 2005 database is com.microsoft.sqlserver.jdbc.SQLServerDriver. Connection URL for the default SQL Server 2005 database is jdbc:sqlserver://localhost:<port>.
    In the connection URL, <port> is obtained from the SQL Server configuration Manager. When the SQL Server 2005 SQLEXPRESS is restarted the port number changes.
    To obtain the <port> in the SQL Server Configuration Manager, select the node SQL Server 2005 Network Configuration>Protocols for SQLEXPRESS. Right-click on TCP/IP node and select Properties. Select the IP Addresses tab. In IP ALL, the TCP Dynamic Ports specifies the <port> value. The connection URL format for another database name is shown in following listing.

  • Problem connecting to SQL Server from JDeveloper 10g using jdbc third party

    I am using Oracle 10g Jdeveloper and I tried to setup a database
    connection to SQL Server using various Drivers for JDBC as Merlin, jtds, inet.tds, etc.
    (I had no problem to set up a connection to an Oracle Database using the
    Oracle JDBC driver).
    When I am testing the connection throughout the wizard, I do receive
    this error message: "Unable to find driver:
    com.microsoft.jdbc.sqlserver.SQLServerDriver".
    I m not understanding from last 3 days where to place the corresponding JAR files so thaI may not get the Error.
    When I hit n trialed at various directories of the JDeveloper as </rootDir/jdbc/lib>
    </rootDir/lib>
    </root/jdev/my Work/Application1/Project1/public_html>
    </root/jdev/my Work/Application1/Project1/public_html/web-inf/>
    when I tested the connection I do received:
    "Unable to find driver:
    xxx.xxx.xxx.xxxxxxx Unable to find driver:
    Obviously it can't locate the Micrososft JDBC driver but I can't
    figure out why.
    I tried all kind of things without any success. Is somebody can help
    me and took me beyond this.
    I m trying to build DataSource connection from JavaBeans.
    Please make me out of this cave. I m not finding any of the way to do this.
    The last code I tried is
    try {
    Class.forName("com.inet.pool.PoolDriver");
    com.inet.tds.TdsDataSource tds = new com.inet.tds.TdsDataSource();
    tds.setServerName( "local" );
    tds.setDatabaseName( "bluff" );
    tds.setUser( dbUserName );
    tds.setPassword( dbPassword );
    DataSource ds = tds;
    Connection con = ds.getConnection(dbUserName,dbPassword);
    Statement stmt;
    ResultSet rs = null;
    Thanks,

    you are confusing me at least as your error is discussing the microsoft driver yet you are configuring the inet datasource.
    I do not use JDeveloper, but you need to make sure that whatever is servicing your web app/JavaBean has access to the driver. Not sure why you are not doing a JNDI look up of the resoure, but because you are not you can stick the driver jar in the lib directory within the WAR bundle. I would suggest that you add the driver to the lib/ext or the lib directory which is loaded at boot time for your web container and then use JNDI to look up your DataSource to reduce your coding maintenance headaches.

  • How can i connect to SQL Server 7.0 on Windons Using JDBC

    How can i connect to Microsoft SQL Server 7.0 on a windows enviroment ?
    in sql server 2000 some jar files are required that is
    What you need to do is actually add all three jar files to your class path individually. There are three jar files that come with this driver the msbase.jar, msutil.jar, and mssqlserver.jar. for sqlQ server 2000.
    now the problem is that i cant find these files on my system. firstly where these files will be located. secondly are they will be used to connect to SQL Server 7.0. thirdly if not what is the procedure.
    My next Problem is that I have Websphere Studio Application Developer. in which their is this facility of Database Webpages its like a wizard which makes automatically beans servlets and JSP but before that you need a Driver Name and and Class Name for to Connect to the Database.
    Can you tell what is the specific Driver Path for the Microsoft SQL Server 7.0 . secondly is this the class which is used to connect to SQL server 7.0 "com.microsoft.jdbc.sqlserver.SQLServerDriver" where can i find this one. for SQL server 7.0.
    please provide some guidance in this regard.

    You can search for the JDBC drivers at, http://industry.java.sun.com/products/jdbc/drivers
    All the three jars that you specified are part of MsSQL Server jdbc driver. You need them (in the classpath) to get connected to the database.
    "com.microsoft.jdbc.sqlserver.SQLServerDriver" is the class in mssqlserver.jar. This is the driver class which will be used to get connected to the database.
    You can search in this forum for writting jdbc code (for Sql Server). If you don't find these jars, give me your e-mail id.
    Sudha

  • I want to use jdbc to connect MS SQL SERVER

    hi,
    I want to use jdbc to connect MS SQL SERVER,not the jdbc-odbc bridge.
    I download the driver from MS,deploy it,but when I connect the database such as:
    <%Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");%>
    <%String sConnStr="jdbc:microsoft:sqlserver://computer2000:1433";%>
    <%Connection conn=DriverManager.getConnection(sConnStr,"sa","123");%>
    <%Statement stmt=conn.createStatement();%>
    but it said
    javax.servlet.ServletException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    how can i work out this problem
    maybe my configure is wrong,please give me a successful sample configuration
    thanks a lot

    Hi,
    I am not sure where you have got the following code from
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    What happens here, is Java Runtime will search for the Class named:
    com.microsoft.jdbc.sqlserver.SQLServerDriver
    If this Class is not in the Runtime Classpath, it will throw the Error that you have got. Kindly get the proper driver as well as ensure that the Class is available in the Runtime Classpath.
    Thanks and regards,
    Pazhanikanthan. P

  • Using INET and DATADIRECT JDBC Drivers to connect MS SQL Server 2005

    Hi,
    I have reqmt to connect SQL server 2005 from ODI using INET and DATADIRECT JDBC drivers to test Local characters Encoding.
    In my case, Oracle is the Source and SQL Server 2005 is the Target. I have problem while interfacing Local Characters to SQL Server 2005 using com.microsoft.sqlserver.jdbc.SQLServerDriver driver( which is default driver provided by ODI). To fix local charatcters issue, I want to try using INET or DATADIRECT JDBC drivers. Please provide me the below of any one has used these Drivers to connect SQL Server 2005 from ODI.
    We are trying to connect to MS SQL Server 2005 from ODI Topology Mgr using INET and DATADIRECT JDBC Drivers. We need the following info to connect to the same,
    --> What are list of the drivers need to be placed in OraHome_1\oracledi\drivers path?
    --> Where can i get the latest driver versions.
    --> What are the JDBC DRIVER and URL formats.
    --> Any other additional configurations?
    --> Does these drivers support interfacing of Local character data.
    Please respond...
    Regards,
    Anil

    Check this article [HOW TO: SQL & JAVA|http://www.shahriarnk.com/Shahriar-N-K-Research-Embedding-SQL-in-C-Sharp-Java.html] for details on how to connect to SQL Server database from C#.NET database applications as well as Java database applications. It also describes how to pass embedded SQL queries (SELECT, INSERT, UPDATE, DELETE), calling stored procedures, pass parameters etc.

  • -net.sourceforge.jtds.jdbc.Driver ERROR WHILE CONNECTING TO SQL SERVER

    Hi,
    While making a new connection to Sql Server Express Edition Database, through Oracle Sql Developer i am getting a problem when retrieving the database.The error is "-net.sourceforge.jtds.jdbc.Driver" .I have downloaded the "jTDS - SQL Server and Sybase JDBC driver " from sourceforge website, but i am confused about where to paste it.
    thanks.

    I'm not sure why you are having the error but I am sure of the following:
    1. This forum is not appropriate for SQL*Developer questions.
    2. Or questions about code from SourceForge
    3. Or Microsoft products.
    It seems unlikely this has anything to do with Oracle so I would recommend you find a forum related to the driver if one exists. Otherwise you can try the SQL*Developer forum but I would be there aren't more than a dozen other people on the product trying to do this.

  • 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

Maybe you are looking for

  • Calculate all days in month from schedule line delivery date for 12 mths

    Hi experts, I am trying to solve a problem and would appreciate any help! Im on BI7. The user will input a date for the schedule line delivery date via a variable. From this date I need to go forward 12 months exactly and display a key figure (outsta

  • Adding an S/MIME certificate to an existing contact in Outlook 2013

    In previous versions of Outlook (e.g. 2010) when you received an S/MIME signed certificate from an external party you could right click on their name in the message and select "Add to Outlook Contacts". This would then store the cert in a contact for

  • I created a Custom list New Form and need to make the text fields read only

    When I use SharePoint Designer and add the read only attribute  to the  SharePoint form field, then it throws  a web part error. but here is the thing, I have current user Filters populating the Form Fields. So the form fields  populate First name ,

  • Spaces randomizes the z-order of windows

    I just got my shiny new iMac yesterday and was really happy to find Spaces and start using it- until I hit a bug Switching Spaces randomizes the z-order of the windows in the Space. For example, if I have a browser window in front of a Finder window,

  • Restoring TDM from TDX?

    Hi, I am frequently working with my offline data profile (Windows - Offline Drive). DIAdem is not willing to save TDM files in that path, so that anytime I forget to change to a local drive the application shuts down destroying the TDM (content 0 Byt