Is it supported to use Microsoft JDBC driver use in Java 7 (and 8) multithreaded applications?

Hello everone
is it supported to use Microsoft JDBC driver (the latest version) with Java 7 multithreaded application?
I am planning to use standard Java 7 threads library and use separate JDBC objects per each thread, i.e. Java threads will not share any JDBC objects among them, only the thread-safe Java collections/data structures will be shared between threads (such as
ConcurrentHashMap etc). The JDBC connections, resultsets, statements, etc will be created and dedicated per each individual thread.
If it is supported - do you expect this design to scale-up well or am I better off using multiple but single-threaded Java/JBDC programs to access SQL Server 2012/2014 from Microsoft JDBC driver?
Thanks
Yuri Budilov
Yuri Budilov Melbourne Australia

>is it supported to use Microsoft JDBC driver (the latest version) with Java 7 multithreaded application?
Yes, so long as:
> Java threads will not share any JDBC objects among them,
>do you expect this design to scale-up well or am I better off using multiple but single-threaded Java/JBDC programs >to access SQL Server 2012/2014 from Microsoft JDBC driver?
Using threads should scale better than using processes (at least on Windows), as there is quite a bit of overhead with a process.  Each process has it's own JRE, it's own GC heap, its own threads...
The bigger question, though, is how this scales on the SQL Server.  Your throughput may be limited by resources on your database server, and the thread's workloads may not be able to run concurrently because of locking. 
David
David http://blogs.msdn.com/b/dbrowne/

Similar Messages

  • Question about load Microsoft JDBC driver for Sql server 2000

    Hello,
    I have some problem while trying load the sqlserver2000 jdbc driver
    My program is a third party application and it works with the other type 4 JDBC driver well. So I tried to use Microsoft SQL server 2000 JDBC driver instead.
    I installed JDBC driver and set up the classpath.
    My error message is:
    "Driver class 'com.microsoft.jdbc.sqlserver.SQLServerDriver' could not be loaded"
    Is above message means that my classpath setup correctly but the application could not load the class or the application could not find the jar file which containes the driver class?
    By the way, the third party application I was using to load this JDBC driver does not certified to use microsoft JDBC driver. But I don't think it matter?
    Thanks for your help
    Hui Lu

    Hello,
    I have some problem while trying load the
    sqlserver2000 jdbc driver
    My program is a third party application and it works
    with the other type 4 JDBC driver well. So I tried to
    use Microsoft SQL server 2000 JDBC driver instead.
    I installed JDBC driver and set up the classpath.
    My error message is:
    "Driver class
    'com.microsoft.jdbc.sqlserver.SQLServerDriver' could
    not be loaded"
    That is an unusual message. Presumably you did not see "NoClassDefFoundError". If you see that it means the class could not be found.
    Is above message means that my classpath setup
    correctly but the application could not load the class
    or the application could not find the jar file which
    containes the driver class?
    By the way, the third party application I was using to
    load this JDBC driver does not certified to use
    microsoft JDBC driver. But I don't think it matter?
    It could. Perhaps the app expects a certain functional level and the driver doesn't support that. And so it bails with the message that you see.
    Or it could mean that you have do something special because it has its own class path, and the driver is not in that.

  • Microsoft Jdbc driver for SQL Server memory leak

    I'm using Microsoft Jdbc driver and see there's some leak after running application for a while. I'm sure that it's from Jdbc driver because I sitch to Jtds and the issue went away. My question is is there anybody knows which web sites talk about memory leak issue in Microsoft Jdbc driver for SQL Server?
    Appreciate your help

    I'm using Microsoft Jdbc driver and see there's some leak after running application for a while. I'm sure that it's from Jdbc driver because I sitch to Jtds and the issue went away. My question is is there anybody knows which web sites talk about memory leak issue in Microsoft Jdbc driver for SQL Server?
    Appreciate your help

  • Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?

    Hi,
    Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?
    This link here indicates this was fixed awhile ago:
    http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx
    However, we are using Microsoft JDBC Driver 4.0 but are noticing that a setQueryTimeout thread is being spawned (of class com.microsoft.sqlserver.jdbc.TimeoutTimer) for every query we execute.
    And, the thread seems to stay around even after the query has finished executing.
    Can anyone confirm whether this is actually fixed?
    Or, does anyone have any ideas how we can avoid having a new thread spawned for monitoring for a query timeout?
    Thanks! 

    Hi,
    Does setQueryTimeout still spawn a thread with Microsoft JDBC Driver 4.0?
    This link here indicates this was fixed awhile ago:
    http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx
    However, we are using Microsoft JDBC Driver 4.0 but are noticing that a setQueryTimeout thread is being spawned (of class com.microsoft.sqlserver.jdbc.TimeoutTimer) for every query we execute.
    And, the thread seems to stay around even after the query has finished executing.
    Can anyone confirm whether this is actually fixed?
    Or, does anyone have any ideas how we can avoid having a new thread spawned for monitoring for a query timeout?
    Thanks! 

  • Connecting to SQLserver 2005 via Web Analysis using a JDBC driver

    We are currently working on a web analysis suite and have been trying to create a SQL spreadsheet data object.
    After downloading and supposedly installing the sqljdbc.jar driver, we are having problems getting a connection to MS SQL server 2005.
    We set the classpath to this driver in the operating system (Windows server 2003) but are unsure exactly how to set this classpath in Tomcat 5.0.28 as recommended by the help file. We have tried editing the catalina.bat and catalina.50.bat in the \Hyperion\common\appServers\Tomcat\5.0.28\bin folder to point to sqljdbc.jar, but to no avail.
    So....does anyone have any experience on setting up the JDBC driver for MSSQLServer 2005 and making a connection in Web Analysis. Could you please give a step by step account of how this is done?

    Hi,
    In the past I have used two methods either updating the registry for the web application or by placing the jar file in the following directory
    \Hyperion\deployments\Tomcat5\WebAnalysis\webapps\WebAnalysis\WEB-INF\lib
    If you do place it in that directory you will need to restart the web analysis web server.
    Then in web analysis studio go to file > new > database connection >Relational
    Select Microsoft SQL Server
    JDBC Driver
    com.microsoft.jdbc.sqlserver.SQLServerDriver
    Connection string
    jdbc:microsoft:sqlserver://<servername>:1433;DatabaseName=<dbname>;SelectMethod=cursor
    Enter username/password
    There is always the Merant SQL server connection that can be used as well.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Gor The result set is closed after switch to latest microsoft JDBC driver

    The same code works fine with the previous version of the microsoft JDBC driver, but throws
    com.microsoft.sqlserver.jdbc.SQLServerException: The result set is closed.
    for the JDBC driver 4.
    Please Help!
    Thanks.

    I found the same exception when dealing with ResultSetMetaData.
    Using the old driver (1.2.2828.100) it was possible to do something like:
    Statement s = con.createStatement();
    ResultSet r = s.executeQuery("select * from <table>");
    ResultSetMetaData m = r.getMetaData();
    r.close();
    s.close();
    int numCols = m.getColumnCount();
    But using the new driver (2.0.1803.100) it complains that the result set is closed.
    The solution was to keep the ResultSet and Statement open until after the ResultSetMetaData is no longer needed. It is somewhat inconvenient because before it was possible to have a utility method that would return a ResultSetMetaData object and not have to worry about keeping the Statement and ResultSet objects around.
    I was hoping for a speed increase for batch inserts by having the latest driver, sadly there is no performance gain.

  • Could not find Microsoft JDBC Driver ???

    Hi all,
    My program could not find the JDBC driver. Why?????
    Here is my environment:
    Platform: Win2000
    Database: Sql2000
    Tool: JBuilder enterprise (trial version)
    JDBC Driver: Microsoft JDBC driver for SQL Server 2000
    I set the CLASSPATH=.;D:\Sql200JDBCDriver\lib\msbase.jar;D:\Sql200JDBCDriver\lib\msutil.jar;D:\Sql200JDBCDriver\lib\mssqlserver.jar
    Here is my javabean:
    package test;
    import java.sql.*;
    import java.io.*;
    public class LoginBean{
    public static boolean login(String strUser, String strPass)     {
    ResultSet rs;
    try{
    System.out.println("before class.forName");//Print trapped error.
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    System.out.println("After class.forName");//Print trapped error.
    java.sql.Connection theConnection = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:8080;DataBaseName ='MyDataBase;User=sa;passowrd="); //Connect to db
    System.out.println("After get connection");//Print trapped error.
    Statement theStatement=theConnection.createStatement();
    rs=theStatement.executeQuery("SELECT username, password FROM login WHERE username= '" + strUser + "' AND password= '" + strPass + "'");
    if(rs.next()) //Fetch username of record
    return true;
    }catch(Exception e){
    System.out.println("before e.getMessage error");//Print trapped error.
    System.out.println(e.getMessage());//Print trapped error.
    System.out.println("after e.getMessage error");//Print trapped error.
    } return false;
    Here are the messages I got:
    before class.forName
    before e.getMessage error
    com.microsoft.jdbc.sqlserver.SQLServerDriver
    after e.getMessage error.
    The program never got throught the statement: Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    What's wrong?????
    thanks in advanced.

    I guess you have a good idea what the problem is. Either the class name you have specified is wrong or the required library is not on the classpath.
    How are you setting the classpath? Are you running your application through JBuilder or through the command line?
    If it's through JBuilder then make sure that you've configured one of their tiresome "Libraries" and that your project has it in its "Required Libraries".
    Never rely on environment variables to supply the classpath - it takes very little effort to set up a classpath for each application you're developing and will ensure you're using the versions of each library that you want to. Personally I make sure I delete the classpath environment variable so there's nothing implicit hiding away.
    Hope this helps.

  • How to use a jdbc driver in caf

    Hi, all.
         I tried to make a ws to access DB with CAF, but I had no idea how to use a jdbc driver(.jar).
        Can anyone do me a favor? Thx 
        PS: my server is ce7.1
    Edited by: Louis HUANG on Jul 27, 2009 1:09 PM

    hi
    If you want to interact with db tables in caf,try like this.
    it may work..
    Using EJB call database tables using jdbc driver.
    Expose EJB as webservice.
    and using External service option of caf utilise this webservice in caf,do the necessary mappings..
    you can search in sdn,how to call DB tables in EJB..
    Regards
    sowmya.

  • Problems showing german special characters using DB2 jdbc driver

    Hi JDBC gurus,
    In my application the special german characters(umlauts...) are not shown correctly when I'm using IBM jdbc driver(type 2). When I switch to jdbcodbc driver everything is correct. So is there any trick, some connection parameter, some property or something like this? Something like "setCharset" or "umlauts" or something? I could not find anything in web :-(
    It is also hard to imagine that nobody has faced this problem. Or it is very trivial...
    The second problem:
    I have downloaded a new driver (com.ibm.db2.jcc.DB2Driver) but when I try to connect with DB I'm getting
    com.ibm.db2.jcc.b.SqlException: No license present. What does it mean - no license? I'm going to clear with our DB admin if the reason can be that I have no rights to connect directly with DB without having client installed locally on my PC. This is only what comes to my mind.
    Environment:
    DB: DB2 7.x
    Web-Server: Tomcat 5.x
    Hibernate 3.1.x

    Actually the problem is ONLY symbol � - scharfes S. Other umlauts are shown correctly...
    What is wrong with that symbol????
    Many thanks in advance,
    Giorgi

  • How to efficiently use an jdbc driver

    hi,
    I have used ifxjdbc.jar for connecting to informix server.
    But i have used that only for query execution.
    I want to know how one can efficiently use a jdbc driver.
    What all the classes that are coming with a .jar file.
    Please help me
    thankz to all

    Add ifxjdbc.jar to classpath.
    Driver Class name is com.informix.jdbc.IfxDriverConnection url is jdbc:informix-sqli://<host>:<port>/<database>:INFORMIXSERVER=<server>Datasource class is com.informix.jdbcx.IfxDataSource

  • Jdbc connectivity using type 4 driver using oracle10g

    Hi while running a jdbc program using type 4 driver using oracle 10 g I am Getting following exception
    java.lang.NullPointerException
    java.lang.NullPointerException
    at Type4ConnectTest.main(Type4ConnectTest.java:31)
    Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.
    OracleDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:169)
    at Type4ConnectTest.main(Type4ConnectTest.java:15)
    My Program Code is..
    import java.sql.*;
    class Type4ConnectTest
    public static void main(String args[])throws Exception
    Connection con=null;
    Statement st=null;
    ResultSet rs=null;
    try
    // DriverManager.registerDriver(new Oracle:jdbc:OracleDriver());
    Class.forName("oracle.jdbc.OracleDriver");
    String url="jdbcracle:thin:@localhost:1521";
    con=DriverManager.getConnection(url,"sarika","sarika");
    catch(NullPointerException e)
    System.out.println("e");
    e.printStackTrace();
    finally
    try
    con.close();
    st.close();
    rs.close();
    catch(Exception e)
    System.out.println(e);
    e.printStackTrace();
    I also set path of ojdbc14.jar and orai18n.jar in environment variable.
    pls help to solve the problem

    Class.forName("SOME_DRIVER_CLASS");Is tricky to use because it will compile not needing to reference the vendors jar file.
    You have to remember to deploy it though where ever you plan to run this program.
    If you are running from command line
    java -cp PATH_TO_JAR Type4ConnectTest

  • How to use Oracle jdbc driver fixedString property?

    Oracle pads values in char columns so if I insert "a" in a CHAR(2) column then I cannot get that record by comparing that column to "a", I should get it by comparing it to "a ". Right?
    To solve this problem the Oracle jdbc driver has the property fixedString but I cannot make it work. (look for fixedString here )
    I'm using ojdbc14.jar driver for Oracle 10gR2 and accessing an Oracle 10gR2 database.
    This is my code:
    try {
    Properties props = new Properties();
    props.put("user", "****");
    props.put("password", "****");
    props.put("fixedString", true);
    Class.forName("oracle.jdbc.driver.OracleDriver");
    String jdbcUrl = "jdbc:oracle:thin:@<host>:<port>:<sid>";
    Connection connection = DriverManager.getConnection(jdbcUrl, props);
    PreparedStatement ps = connection.prepareStatement(
    "SELECT * FROM MY_TABLE WHERE MY_TABLE_ID = ?");
    ps.setObject(1, "abc"); // (*)
    // MY_TABLE_ID is CHAR(15)
    ResultSet rs = ps.executeQuery();
    while (rs.next())
    System.out.print("data: ");
    System.out.println(rs.getString("MY_TABLE_ID"));
    rs.close();
    ps.close();
    connection.close();
    } catch (SQLException ex) {
    ex.printStackTrace();
    } catch (ClassNotFoundException ex) {
    ex.printStackTrace();
    The above code executes fine (no exceptions thrown) but the ResultSet is empty after executeQuery().
    If I change the line (*) for
    ps.setObject(1, "abc ");
    Then I get the column I wanted. So it seems the driver is ignoring the fixedString option.
    I've also tried changing the line (*) for
    ps.setObject(1, "abc", java.sql.Types.CHAR);
    But the ResultSet I get is empty again. What am I missing?
    Thanks in advance

    Es un Bug se corrige en la versión del OAS 10.1.2.3
    Bug 10222534: UNABLE TO SET FIXEDSTRING PROPERTY IN DATASOURCE

  • Error when going to install jdbc driver using JSPM

    Hi All,
    I am trying to Install JDBC driver using JSPM but its show error like
    <component location="\\xxxxxx\sapmnt\trans\EPS\in\com.sap.aii.adapter.lib.sda" status="ABORTED" dplorder="0" description="1. Runtime name of component [sap.com~com.sap.aii.adapter.lib] is changed from [sap.com~SAP-XI3RDPARTY~com.sap.aii.adapter.lib] to [com.sap.aii.adapter.lib]. Please, first remove the DC and then proceed with deployment" vendor="sap.com" name="com.sap.aii.adapter.lib" csn="BC-XI-CON-AFW" type="DC" version="7.3001.20110318104827.0001" size="0">
    I have also searched for sap.com~SAP-XI3RDPARTY~com.sap.aii.adapter.lib but nothing found. Please suggest how to remove DC?

    Hi Batra,
    Thanks for quick reply.
    I already followed the second link given by you and My jdbc driver installed properly first time but the jdbc adapter was not showing in communication channel. Only RFC and SOAP are showing there. In second link  com.sap.aii.adapter.lib  showing under SAP-XI3RDParty under software Component column but in my system it's not showing there .Software Component column coming blank in my case. So I add additional property Software Component in provider.xml whose value was sa.com/SAP-XI3RDPARTY and deployed it again using JSPM. Now jar deployed  in folder sap.com~SAP-XI3RDPARTY~com.dap.adapter.lib/lib rather than com.dap.adapter.lib/lib. So I removed property Software Component and tried to deploy again but now showing the problem
    <component location="\\xxxxxx\sapmnt\trans\EPS\in\com.sap.aii.adapter.lib.sda" status="ABORTED" dplorder="0" description="1. Runtime name of component [sap.com~com.sap.aii.adapter.lib] is changed from [sap.com~SAP-XI3RDPARTY~com.sap.aii.adapter.lib] to [com.sap.aii.adapter.lib]. Please, first remove the DC and then proceed with deployment" vendor="sap.com" name="com.sap.aii.adapter.lib" csn="BC-XI-CON-AFW" type="DC" version="7.3001.20110318104827.0001" size="0">
    However I have deleted folder sap.com~SAP-XI3RDPARTY~com.sap.aii.adapter.lib.

  • How to know which type of jdbc driver used in my application

    How to know which type of jdbc driver used in my application.

    My approach will be....
    Type1: you have to have ODBC s/w install on your machine...even the connection string starts with jdbc:odbc....so it can be identifed easily
    Type2: you have to install client s/w in your machine...if you are using oracle oci driver ...you need to install oracle client s/w
    Type3: you use servername / port to connnect to middleware
    Type4: you do not need any client s/w
    So, If your application works without any client s/w on your machine....you might be using Type4/Type3 driver.....otherwise Type2
    Someone pls add more ....

  • Microsoft jdbc driver class not found error

    hello,
    i have installed jdbc driver for 2005 from microsoft. i have put sqljdbc.jar in the classpath as well as in jbuilder 2006 library. still i get the following error.
    java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:164)
    at dbinfo.dbinfo.getConnection(dbinfo.java:27)
    at dbinfo.dbinfo.displayDbProperties(dbinfo.java:64)
    at dbinfo.dbinfo.main(dbinfo.java:150)
    Error Trace in getConnection() : com.microsoft.jdbc.sqlserver.SQLServerDriver
    Error: No active Connection
    what am i missing?

    i have the same problem can anyone help me in setting the classpath to the drivers. i am new to java plz help me
    thanks in advance

Maybe you are looking for

  • RA VPN on ASA and Split Tunneling

    Hello Forum, I'm having an issue with RA VPN and split tunneling. Our company doesn't allow split tunneling. I have the following.... ASA 5520 - ASA Version - 8.0(3) Group Policies defined for different groups. My test group, I thought I disabled spl

  • Default the GR based IV check in PO based on account assignment category

    Hi Experts, We have the below business requirement based on GR based IV check in the PO. We knows that this can be automatically defaulted by using the two master records. 1.Vendor master, 2.Purchase info record. But our cilents needs this field to b

  • Is SilverLight compulsory for running a Labview program?

    Hi, I am using a computer on which Silverlight isn't installed (the microprocessor doesn't have SSE instructions so I am not able to install it). While installing Labview 11 I got a message saying SilverLight isn't installed. I will test my labview p

  • SQL Server Agent Trouble inside the IPIVR

    I'm face a problem with my SQL server agent inside CRS the version is 7.0, I have already repair the IPIVR software and restart this one, but it continue with alert inside the CRS. Does somebody know if have some patch to apply or some extra configur

  • I have a problem with my iTouch app store aplication

    ok... the app store aplication doesn't works on my iPod. when I try to download any app I click on the button download app but after it i click the button and this get 'distorted' so i can't download apps on my iPod... what's going on here details: -