Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MS SQL Server






SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







Problems With JDBC


I downloaded the latest version on JDBC from Microsoft and I got problems.
Indeed, when fetching a smallint from SQL Server i got instead an Integer.
How can i do to avoid such a problem?
Some hints?


many tanks, gaetano


View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Cannot Load JDBC Driver Class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'
I have read similar posts to this, but I am still having problems.

I am trying to use connection pooling to connect to a local SQL Server 2005 database. I am running my application using
MyEclipse Enterprise Workbench. I have verified that sqljdbc.jar resides in "WebRoot/WEB-INF/lib/"

"WebRoot/WEB-INF/web.xml":
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsichemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <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>


"WebRoot/META-INFcontext.xml":

<?xml version="1.0" encoding="UTF-8"?>
<Context>
    <Resource name="jdbc/DefaultDS"
              auth="Container"
              type="javax.sql.DataSource"
              username="tec"
              password="tec"
              driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDrive"
              url="jdbcqlserver://localhost:1433/tec;databaseName=tec;user=tec;password=test;"
              validationQuery="select 1"
              maxActive="10"
              maxIdle="2"/>
</Context>

Classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="con" path="com.genuitec.eclipse.j2eedt.core.J2EE14_CONTAINER"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/dom.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxen-full.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxp-api.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jdbc2_0-stdext.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/sqljdbc.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jstl.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/mail.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/sax.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/saxpath.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/standard.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xalan.jar"/>
    <classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xercesImpl.jar"/>
    <classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>

Code to connect:

import java.io.Serializable;
import java.sql.*;

import javax.sql.*;
import javax.naming.*;
    public int testConnect(){
        Connection conn = null;
        InitialContext ctx = null;
        java.sql.Statement stmt = null;

        try {
            ctx = new InitialContext();
            Context envCtx = (Context) ctx.lookup("java:comp/env");
            DataSource ds = (DataSource) envCtx.lookup("jdbc/DefaultDS");/*This is generating the Cannot load JDBC driver class... error*/
            conn = ds.getConnection();
            stmt = conn.createStatement();
            return CONSTANT.SUCCESS;   

    } catch (Exception e) {
        return CONSTANT.FAILURE;
    }finally {
        try {
            if (stmt != null)
        stmt.close();
            if (conn != null)
        conn.close();
            if (ctx != null)
        ctx.close();
        } catch (Exception ex) {
            // do nothing
            return CONSTANT.FAILURE;
        }
    }
    }

Any ideas would be greatly appreciated.

View Replies !   View Related
MS JDBC Driver Incompatibility With JDBC 3.0 Specs
Hi all,





We've just stumbled on a 1.0 version incompatibility with the JDBC specs.





Problem: A table with SMALLINT column. According to JDBC specs version 3.0


(p.B-179) and 4.0 (p.221)), the value should be converted to Integer type.





Unfortunatelly we get a Short object :(





Now, I remember, this case was also affecting old JSQLConnect driver from


DataDirect. Could that problem sneak to new MS driver too?





Please let me know any resolution to this problem if exists.


The issue has not been fixed in CTP 1.1 version. Any ideas if it can be fixed??




Cheers,


Piotr

View Replies !   View Related
2000 JDBC Vs 2005 JDBC
 

I've got an import app written in Java.  One table I'm importing from contains 22 million records.  When I run the app in a 2000 environment, I have my max heap set at 512, and the table gets imported.  When I run in a 2005 environment, I have to change the max heap to 1152 or it will error out with a similiar error:
 
com.microsoft.sqlserver.jdbc.SQLServerException: The system is out of memory. Use server side cursors for large result sets:Java heap space. Result set size:854,269,999. JVM total memory size:1,065,484,288. (<--this is with max heap at 1024)
 
what is the difference between the 2000 and 2005 JDBC that I have to set max heap in one and not the other?

View Replies !   View Related
Help With JDBC Driver
Hello all,I have a question about the SQL Server JDBC driver. I was wondering ifanyone knows what the default prefetch size is (in number of rows).Also, does anyone know if an entire packet is sent (i.e. padded withnull values) if there is not enough data to fill it?Thanks for your help!ty

View Replies !   View Related
JDBC With MSDE
I have a MSDE database that I am trying to connect to with JDBC. I don'thave SQL Server installed. Is this possible? When I try to connect I getthe error:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver forJDBC][SQLServer]Login failed for user 'sa'. Reason: Not associated with a trusted SQL Serverconnection.From what I've read on the web it looks like I need to set the securitysettings to allowfor SQL authentication as well as NT authentication. Is that correct? Andcan thatbe done with just MSDE?I think that I have MSDE 2000 installed (it actually came with a differentapplication).I just downloaded the latest SQL Server JDBC driver.Thanks,Bruce

View Replies !   View Related
Need A JDBC Driver
I need a free, redistributable JDBC driverfrom MS SQL Server. (MSDE2000a)

View Replies !   View Related
JDBC For MS SQL Server
Dear all,Where can I find JDBC for MS SQL server?Thx for reply.Victoria

View Replies !   View Related
Please Help, Jdbc Error
I am trying to access ms sql server 2000 using jdbc, the code compiled but produce this kind of error:


java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establi
hing socket.
at com.microsoft.jdbc.base.BaseExceptions.createExcep tion(Unknown Sourc
)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getExceptio n(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source

at com.microsoft.jdbc.sqlserver.SQLServerImplConnecti on.open(Unknown So
rce)
at com.microsoft.jdbc.base.BaseConnection.getNewImplC onnection(Unknown
ource)
at com.microsoft.jdbc.base.BaseConnection.open(Unknow n Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager .java:512)
at java.sql.DriverManager.getConnection(DriverManager .java:193)
at org.apache.jsp.addvideo$jsp._jspService(addvideo$j sp.java:66)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWra pper.service(JspSe
vlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:
82)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(App
icationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(Application
ilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapper
alve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipelin
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.ja
a:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943

at org.apache.catalina.core.StandardContextValve.invo ke(StandardContext
alve.java:201)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipelin
.java:566)
at org.apache.catalina.valves.CertificatesValve.invok e(CertificatesValv
.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipelin
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.ja
a:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943

at org.apache.catalina.core.StandardContext.invoke(St andardContext.java
2344)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.
ava:164)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipelin
.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatch
rValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipelin
.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.
ava:170)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipelin
.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java
462)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipelin
.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.ja
a:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943

at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineVa
ve.java:163)
at org.apache.catalina.core.StandardPipeline.invokeNe xt(StandardPipelin
.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.ja
a:472)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:943

at org.apache.catalina.connector.http.HttpProcessor.p rocess(HttpProcess
r.java:1011)
at org.apache.catalina.connector.http.HttpProcessor.r un(HttpProcessor.j
va:1106)
at java.lang.Thread.run(Thread.java:534)




Here is my full code I'm using jsp for accessing the database



<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--
.style1{color: #FF0000}
-->
</style>
</head>

<body>
<%
String title = request.getParameter("Title");
String price = request.getParameter("Price");
ResultSet rs = null;
try{
DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
Connection connection =DriverManager.getConnection("jdbc:microsoft:sqlserver://WIN-WBL8VT0HEPJ:1433","sa","sa");
if (connection != null)
{
System.out.println("Succesfully connected");
Statement stmt = connection.createStatement();
String query = "Insert into Video (Title, Price) values('" + title + "','" +price+ "')";
stmt.executeUpdate(query);

query = "select * from Video";
rs = stmt.executeQuery(query);
%>
<h4 class="style1">.: A new video titled: <%= title %> has been added with a price of <%= price %> :.</h4>
<hr>
You currently have the following videos:
<table width="50%" border="1">
<tr>
<td><div align="center"><strong>Title</strong></div></td>
<td><div align="center"><strong>Price</strong></div></td>
</tr>
<%
while(rs.next()){
%>
<tr>
<td><%= rs.getString("Title") %></td>
<td><%= rs.getString("Price") %></td>
</tr>
<%
}
stmt.close();
connection.close();
}
}catch(Exception e)
{
System.err.println("Cannot connect to database server");
e.printStackTrace();
}
%>
</table>
<div align="center"><br>
<a href="video.html">back</a>
</div>
</body>
</html>


Anyone know what is wrong?

View Replies !   View Related
JDBC Driver
Is oracle and Microsoft JDBC drivers are same? Oracle 9i comes with JDBC, can I use the same driver to access the Microsoft SQL Server?

View Replies !   View Related
Need JDBC Driver For MS SQL 7.00.847
Hi
I just downloaded the Microsoft JDBC Driver for SQL Server 2000. Now it tells me SQL Server 7 is not supported. :o I already checked the JDBC Driver list on suns site. Its quite long and only states MS SQL Server without any version number. Can you recommend a particular driver? Preferrably without any cost. :D
Or am I better of with the jdbc/odbc bridge?

Thanks

Shabassa

View Replies !   View Related
JDBC Drivers
Is anyone out there using Unix/Java/Sun app server to connect to SQL Server via JDBC? If so, what drivers are you using? We are currently testing with WebLogic's BEA JDBC driver. Does anyone have any feedback on it?

View Replies !   View Related
Problems With JDBC
Hi,

Anyone here had difficulty logging in using JDBC to SQL Server 2000? I've an Java app that works perfectly with my test site and test database, but can't connect when I deploy at the customer location. I consistently get an error saying "Login failed for user 'foo'". Yet I can connect with the same user/password from an ASP page using ADO. This is with Microsoft's JDBC driver.

Tried a bunch of stuff
--> same thing happens with another type 4 driver (JTurbo)

--> Security permissions for user are fine (can read and write to database), and global settings are set to SQL Server authentication (not Win NT)

Anyone have any ideas for other things to check? My next step is to try the Sun JDBC-ODBC bridge.

Thanks, WILL

View Replies !   View Related
SQL Server And JDBC
Does anyone know of a good JDBC for SQL Server 2000?

View Replies !   View Related
Sql Server 7 And JDBC
Are there separate jdbc drivers for Sql Server 7 or should I use the 2000 drivers?

View Replies !   View Related
JDBC Connection
this url is having problem while making connection to SQL Server

jdbc:XXX:sqlserver://<host>:1433;DatabaseName=<name>
error:
"The requested instance is either invalid or not running."

View Replies !   View Related
JDBC Driver For MS SQL 7
Hi guys,

Where can I download the JDBC Driver for our MS SQL Server 7 ?

Thank you.

View Replies !   View Related
Jdbc Problem
Hi
I have a java program which uses sql.It supports sql 2000 and 2005.The user can enter a command from which he can choose to what server type he wants to connect.It is something like :

" c:connect [jdbc driver for 2005] [server] "

Now i have to do some different operations when user connects to 2000 and other operations when user connects to 2005.
The problem is that when using jdbc driver for 2005 he can also connect to mssql server 2000.
How can i find out to what server type he is connecting to?

i hope i explained it clearly enough
thanks

View Replies !   View Related
JDBC Driver?
Hi,

Does SQL Server Express ship with a JDBC driver? ... Hardly so, but is it available somewhere?

Rgds and thanks, PP

View Replies !   View Related
Jdbc Driver
we are currently using ms jdbc driver 2.2 to access our sql server 2000. we are upgrading to sql server 2005, is my current jdbc driver compatible with 2005, or do I have to use the new jdbc driver 1.1 for 2005.

Thanks

View Replies !   View Related
No Way To Do An Insert With JDBC?
I started with a simple insert on one of my tables.  It throws an exception for trying to place NULL in one of two calculated fields in the table.
I then tried setting up a simple stored procedure and calling it using:
 
CallableStatement statement = con.prepareCall("? = call dbo.AddSignedForms");
statement.registerOutParameter(1, java.sql.Types.INTEGER);
statement.execute();

 
Which generates this exception:
com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '@P0'.

of course there is no such expression in any of the code.
 
I then set up a simple two column table called tblTestJDBC.  now i'm getting this error:
com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'dbo.tblTestJDBC'.

Btw we DID manage to get a simple select statement to work from my applet.  Nothing else has.  Is this the MS JDBC driver?  Should I just avoid using it or are we missing something here?

View Replies !   View Related
Driver Jdbc
Hi Mixxo,
I also am having this problem! if you get an solution,    
send me an answer or add my msn: griciolli@hotmail.com

View Replies !   View Related
Driver JDBC
hi Mixxo,
I also am having this problem! if you get an solution,    
send me an answer or add my msn: griciolli@hotmail.com

View Replies !   View Related
Jdbc Driver
what is the jdbc driver for sql express? is it "sqljdbc"? then what is its "complete" name in the class path:"com.microsoft.sqlexpress.sqljdbc"? and for the conection url is it "jdbc:microsoft:sqlexpress://localhost/sqlexpress"?

View Replies !   View Related
Help: JDBC 1.22 And SQL 2000
HI, all

I need to write a program, which using VM 1.1.8.

So I need to find the JDBC driver version 1.22, Can anyone help me???

Please Reply, a link for download jdbc 1.22 or any other solutions .

Thank you!

View Replies !   View Related
JDBC With SQL Express
The java code :

  Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

   String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
     "instance=SQLEXPRESS;databaseName=UPM;integratedSecurity=true;";
  Connection con = DriverManager.getConnection(connectionUrl);


returns "connection refused" no matter what I do.

 

I've used the surface config tool to enable TCP, I've added sqlsrvr.exe to the firewall exceptions, I've tried a dozen or so variations on the connection string.

I can connect to the database using the Management Studio.

 

Any ideas what I'm missing ????

Thanks.

View Replies !   View Related
JDBC Connectivity With SQL Server
How do I configure the MS-SQLSERVER to accept JDBC connections andprocess the sql?I'm using SQLSERVER 2000 on Windows NT.Thanks for your help

View Replies !   View Related
JDBC ResultSet And Cursors
Hi everyone-I'm using the Microsoft JDBC driver for SQL Server 2000 and I'm tryingto avoid using server cursors.Is there a way to guarantee that every query will not create aserver-side ResultSet with a cursor? In other words, I want everyResultSet to be loaded into the client's (the web server's) memory.Does setting the "selectMethod" connection property guarantee this?Does SQL Server automatically decide which method is best and if so,what is the default choice?I would appreciate any insight. Thanks in advance!

View Replies !   View Related
MS SQL Using TSQL Via JAVA Jdbc
Hello. I am having trouble finding a descent API for executing TSQLvia JDBC. I have tried the Microsoft driver AND the JDTS driver's butget the same syntax errors. I am hoping there is a good solution alsofor executing scripts using the same. Any help is MUCHappreciated.Thx.

View Replies !   View Related
JDBC Connections W/ AD Login?
I'm a newbie w/ SQL Server 2005.We will be connecting to SQL Server 2005 via JDBC. We have made thiswork by using an SQL Server account, rather than an Active Directory(AD) account, even though SQL Server IS in mixed authentication mode.Does mixed mode mean you can connect either way, but only using MS SQLServer interfaces (like Mgmt Studio), and not something like JDBC?Can we connect using JDBC w/ an AD login? If so, what form does thelogin take? Is the login not in 'DOMAIN/LOGIN' form?What is the best practice for this sort of thing? We would prefer touse AD logins (that a sysadmin creates) rather than having a separate(and probably equal) set of SQL Server logins.Any help appreciated.thanksaj

View Replies !   View Related
Secure Jdbc And Mssql
i have weblogic (7 and 8.1) installations that need to talk securelyvia JDBC to mssql database. preferrably using type4 (or at leasttype2) driver. is there anything out there that can be of any help?thank you.-anton

View Replies !   View Related
JDBC With Mulitple Databases
Dear all,Our application needs a bit of database redundancy.Our application only accesses database for reading purposes.We want to have two databases in separate machines. Incase one databaseserver dies the application should automatically extract data from theother server.Is there any JDBC driver available so that it can detect failure in themain database server and then tries to extract data from the standbydatabase server?Kind regards--Posted via http://dbforums.com

View Replies !   View Related
Sql Server Jdbc Driver
Hi at all, i'm new here, your communitiy seems too much preparated.
My question is simple...
i must to connect via jdbc to a ms sql server 2000 database, but i'm in doubt to select which jdbc driver to use. your suggest over microsoft'drivers? i found on the internet the open source drivers jdts...what about them?

thank you and excuse for by bad english! :p

View Replies !   View Related
SQL Server, JBoss And JDBC
I am having difficulty connecting to a SQL Server 7.0 database. I have an application running on JBoss 3.2.x, and which connects to an Oracle database without problem. However, I also need to have the application connect to a SQL Server 7.0 database.

I have a set of jar files which are added to my classpath for SQL Server. There were three jars (msutil.jar, msbase.jar and mssqlserver.jar) that had to be added to the classpath to get that far. However the application reported that the connection could not be established.

So, I wrote a java class to see if I could replicate the problem, or establish a connection and possibly figure out whether it was the application or the database. The class threw an exception and indicated that the driver was for SQL Server 2000, and was incompatible with SQL Server 7.0.

Has anyone used SQL Server 7.0 with JBoss and can point me in the right direction?

Thanks.

View Replies !   View Related
Weblogic JDBC Driver And SQL
I appear to have an issue here with WebLogic and SQL Server. The WebLogic server is set up to create a pool of connections (max 15, min 4) to the SQL server. The idea is that connections are "leased" to the application for the duration of a transaction and then returned to the pool at the end of the lease. The pool can grow to up to 15 simultaneous connections -- after that the applications must wait for the next available connection in the pool.

As activity subsides, connections are supposed to be dropped down to the minimum number of 4 connections (which are maintained open continuously).

The problem that I can see from SQL is that there are tens of connections that are open (should not be more than 15, right?) and some of these connections have been held open for several days (going back to the last time we rebooted the server 2 weeks ago). I am told that this is a relatively new phenomenon; new within the last 3 months, anyway. I have tried killing some of these processes manually and now they show up in "Current Activity" as being in a "Killed/Rollback" state.

Does anyone have any experience with JDBC/Weblogic and SQL? Any experiences similar to this?

More information:
SQL Server:
SQL Server 2000 (SP3)
Windows NT (SP6)

WebLogic Server:
Weblogic 6.1
Windows 2000 (SP4)
Weblogic JDBC Driver (6.1)


Any input would be welcome.

Regards,

hmscott

View Replies !   View Related
[JDBC] GetMoreResults(int Current)
Helllo.

My stored procedure returns two cursors. I want to keep first ResultSet returned from CallableStatement and read second. When I'm doing getMoreResults() on CallableStatent the first cursor is closing. So I tried this:

CallableStatement.getMoreResults(Statement.KEEP_CU RRENT_RESULT)

but then I'm getting such strange exception:

java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseCallableStatement.getM oreResults(I)Z


Do you know how could I get round it?

(I'm using Microsoft JDBC Driver)

Kuba Królkowski

View Replies !   View Related
Is There A Free JDBC Driver For 6.5 SQL
Is there a free JDBC driver for MS Sql Server 6.5?

Thanks,


Mark Blackburn o `"._ _ M onterey
mark@mbari.org o / _ |||;._/ ) B ay
Science at it's Best! ~ /@ @ /// ( ~ A quarium
(831) 775-1880 ( (`__, ,`| R esearch
http://www.mbari.org/ '.\_/ |\_.' I nstitute

Database Administrator
MBARI Personal Web Page: http://www.mbari.org/~mark/

View Replies !   View Related
Regarding JDBC Connectivity In MSSQL
Hi,

Am using Mcafee and it has a built in MSSQL Database. Am not able to get data frrom database. Can anyone let me know how to connect to Built in MSSQL database using JAVA? Need very quick reply. Any help is greatly appreciated.

thanks,
Jags

View Replies !   View Related
I NEED THE JDBC DRIVER FOR MS SQL SERVER
please help it's urgent i badly need the jdbc driver for mssql for my project
thank u

View Replies !   View Related
Error With JDBC Driver
 

hi, i am using sqljdbc.jar in a java applet and i am using Netbeans for development. i am able to connect with the SQL Server from the IDE. however, when i try to debug the SQL part of the code, i am getting an exception at :
 

DriverManager.registerDriver(new com.microsoft.sqlserver.jdbc.SQLServerDriver());
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl="jdbcqlserver://localhost:49182;databaseName=NanoBase;";
Connection con = java.sql.DriverManager.getConnection(connectionUrl, "test", "Walt787sop289");
 
where it says that it cannot find the class. i am also putting down the exception information.
 
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at com.sun.javaws.Launcher.executeApplication(Launcher.java:1273)
 at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1219)
 at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1066)
 at com.sun.javaws.Launcher.run(Launcher.java:105)
 at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: com/microsoft/sqlserver/jdbc/SQLServerDriver
 at VncViewer.performSql(VncViewer.java:115)
 at VncViewer.readParameters(VncViewer.java:743)
 at VncViewer.init(VncViewer.java:152)
 at VncViewer.main(VncViewer.java:53)
 ... 9 more
Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.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 com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:256)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
 
i am currently using java web start to debug the application. earlier, the application was running smoothly during debug (when not being run through java web start), but was failing to run when started externally say within a html file as an applet. however, when i used java web start, the exception is being pointed to the line in bold. i have added sqljdbc.jar to the list of libraries and have added it under the compile as well as the run time configuration. i would appreciate if this exception could be resolved. if i have to configure anything in the classpath, pls suggest how i can configure it under netbeans.
 
regards,
anant

View Replies !   View Related
JDBC Driver Vs ODBC?
Hi;
I am having problem figuring out if the JDBC Driver for MS SQL Server 2005 is faster or setting up a data source from Administrative tools/Data Sources. I have run several tests and in all tests, the odbc datasource is faster. In that case, why having the trouble of downloading a driver if I am not wrong. I have understood that the native driver is always faster than the odbc bridge.
Thanks in advance

View Replies !   View Related
JDBC Equivalent Of SqlBulkCopy
 

Hi,
 
Is there a JDBC equivalent of the SqlBulkCopy command?
 
Simply using batched INSERTs, it takes days to insert 1m rows into SQL Server. However using C# client that uses SqlBulkCopy I can load it in about 1 hour.
 
Thanks in advance,
G.

View Replies !   View Related
JDBC And Sql Server 2000
Hi
 
I am using JDK 1.6 .  I have downoladed the JDBC driver from
http://www.microsoft.com/downloads/details.aspx?familyid=07287B11-0502-461A-B138-2AA54BFDC03A&displaylang=en
 
This page mentions certain versions of JDK that this driver works with, but 1.6 is not one of them.
 
How can I use this driver with JDK 1.6?
 
 
Thanks
J.

View Replies !   View Related
JDBC Disconnects, Can't Reconnect
Hi,
 

Our environment is:
Windows Server 2003, Service Pack 2
SQL Server Express 2005
SQLServer JDBC driver 1.2
Sun JDK 1.6 (we tried this on JDK 1.5 as well)
There is no virus protection software on the host, and no firewall is enabled.

 
Our problem is that the JDBC connection running on the localhost periodically gets disconnected, and then we can't reconnect to the database at all, unless we physically power cycle the server. The error message we receive is: "Software caused connect on abort: recv failed"

 
This is a very strange situation, and to illustrate, I created the following command-line program:

 
public class DBTest {

        public static void main(String[] arg) throws Exception {
                Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
                Connection conn =
DriverManager.getConnection("jdbcqlserver://127.0.0.1:1433;databaseName=datamart",
"username", "password");
        System.out.println("Connected");
        conn.close();
        }
}
 

Essentially, this program verifies that a database connection can be made to the SQL Server instance on the local host.

 
Executing this from the command line works the vast majority of the time.

 
However, once the Web application running on the same host encounters the JDBC disconnection issue, executing this program from the command line results in the following exception:

 
C:Documents and Settingsfrank>java -cp sqljdbc.jar;. DBTest
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: Software caused connect on abort: recv failed
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.terminate(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSChannel.read(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSReader.readPacket(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSCommand.startResponse(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(Unknown Source)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
        at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at DBTest.main(DBTest.java:7)

 
There is no way to obtain further access to the database, except by power-cycling the machine. Shutting down and then re-starting the SQL Server instance does not help, nor does restarting any individual process on the server.
 

Something permanently disables connection to the database server, and only a hard reset of the OS solves that problem.

Any suggestions would be most appreciated, as this is a serious, mission-criticial problem for us right now.

 
Thanks,
 
-- Frank

View Replies !   View Related
Can't Get IntegratedSecurity With JDBC Driver
Hi;

I used SQLServerDatabaseMetaData (which requires a connection to return this data which seems unnecessary) to get:

name: Microsoft SQL Server 2005 JDBC Driver
version: 1.1.1501.101
Passing a url of: jdbc:sqlserver://localhost:1433;DatabaseName=Northwind;IntegratedSecurity=true

I get the error:
Oct 7, 2006 3:46:09 PM com.microsoft.sqlserver.jdbc.AuthenticationJNI <clinit>
WARNING: Failed to load the sqljdbc_auth.dll
Exception in thread "main" com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication.

I copied over x86sqljdbc_auth.dll and then it worked. I assume this is required with the jar file. This leads to a couple of questions:

What are the files xax86sqljdbc_xa.dll & x64 files for? Are they needed?
The jar file can just travel with my java code. Should the dll do the same or does it need to be in the path and/or the default directory?
Are there any other files needed or just these two?

thanks - dave

View Replies !   View Related
Can't Install JDBC On OpenSUSE
When i try to execute



Code Snippet
>java -classpath /usr/java/jdk1.6.0_04/lib/sqljdbc.jar com.microsoft.sqlserver.jdbc.SQLServerDriver
 
Java throws and exeption:



Code Snippet
Exception in thread "main" java.lang.NoSuchMethodError: main
 
 





What can i do?
I'm using openSUSE on VMWare.

View Replies !   View Related
JDBC 1.2 Driver BigDecimal Bug
Hi, All!

I'm using Borland's ProcedureDataSet to retrieve data from a SQL 2005 database using the JDBC 1.2 Driver.
My problem is with the money data type. The Borland's component translate money into BigDecimal and if the value
in the database in NULL then I get a NullPointerException.

On MSDN I saw money was referred as Double which is wrong!
Any Ideas?

View Replies !   View Related
Getting JDBC Metadata For Synonyms
Using the Latest JDBC Driver from SQLExpress I'm attempting to get use the getTable() method to get information about database objects that the user can access/alter.   Works fine for for tables and views, but can't seem to get any information returned for synonyms.

Is it possible to get information for synonyms, e.g. column definitions? or am I'm missing some setting in the connection.

Any Help would be appreciated!

Dave.

View Replies !   View Related
JDBC Driver And SQL Profiler
Hi,

I'm trying to debug some deadlock problems I'm having with an XA JDBC application that uses the Microsoft JDBC driver.

Problem is, I can't see much of the info in the Profiler I always get the TextData colum filled with things such as :
'sp_cursorclose 180150269' for my BatchCompleted. I've tried other event but I can't see any of the SQL code. My other application does not use XA and I see the statements fine.

I was wondering how I could get to see the TextData with the SQL sent to the server via the XA connection if it's possible. Is it another event or column I need?

Thanks for the help,
 
Greg

View Replies !   View Related
MSSQL JDBC Problems
I'm having some problems with my JApplet and MS-SQL 2005 using JDBC 1.2 driver

most of the time the applet works just fine but every now and then (after reloading 5 times or so) I get one of these messages in console






Code Snippetbasic: New window ID: 36049c3
basic: Value of xembed: 1
basic: setWindow: call before applet exists:36049c3
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@1eef0a8, refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@7a7f6b
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
basic: completed perf rollup
network: Connecting socket://192.168.5.4:1433 with proxy=DIRECT
network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.class, version: null]
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.class with proxy=DIRECT
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.class with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.properties, version: null]
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.properties with proxy=DIRECT
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl.properties with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.class, version: null]
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.class with proxy=DIRECT
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.class with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.properties, version: null]
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.properties with proxy=DIRECT
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/com/microsoft/sqlserver/jdbc/SQLServerResource_nl_NL.properties with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
com.microsoft.sqlserver.jdbc.SQLServerException: The result set is closed.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.checkClosed(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(Unknown Source)
at Main.Laden(Main.java:1019)
at Main.init(Main.java:267)
at sun.applet.AppletPanel.run(AppletPanel.java:419)
at java.lang.Thread.run(Thread.java:619)
network: Connecting socket://192.168.5.4:1433 with proxy=DIRECT
network: Cache entry found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/organisatieschema.jar, version: null]








Code Snippetbasic: New window ID: 3604eaf
basic: Value of xembed: 1
basic: setWindow: call before applet exists:3604eaf
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@1eef0a8, refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@1ba4a47
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
basic: completed perf rollup
network: Cache entry not found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/org/jdesktop/swingx/plaf/resources/swingx.class, version: null]
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/org/jdesktop/swingx/plaf/resources/swingx.class with proxy=DIRECT
network: Connecting http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/org/jdesktop/swingx/plaf/resources/swingx.class with cookie "password=admin; username=admin; autologin=true; ZDEDebuggerPresent=php,phtml,php3; PHPSESSID=rqdrj8p11i0muta0f5kq9p4qu1"
network: Cache entry found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/swingx-0.9.0.jar, version: null]
network: No certificate info for unsigned JAR file: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/swingx-0.9.0.jar
network: Connecting socket://192.168.5.4:1433 with proxy=DIRECT
28-jan-2008 7:57:29 com.microsoft.sqlserver.jdbc.TDSReader throwInvalidTDS
SEVERE: TDSReader@101f935 ( ConnectionID:7 TransactionID:0x0000000000000000) got unexpected value in TDS response at offset:1503
com.microsoft.sqlserver.jdbc.SQLServerException: Unexpected IOException processing character stream Reader.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.DDC.convertReaderToString(Unknown Source)
at com.microsoft.sqlserver.jdbc.DDC.convertNonUnicodeNonPLPToObject(Unknown Source)
at com.microsoft.sqlserver.jdbc.ServerDTVImpl.getValue(Unknown Source)
at com.microsoft.sqlserver.jdbc.DTV.getValue(Unknown Source)
at com.microsoft.sqlserver.jdbc.Column.getValue(Unknown Source)
at com.microsoft.sqlserver.jdbc.Column.getValue(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getString(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getString(Unknown Source)
at Main.Laden(Main.java:1024)
at Main.init(Main.java:267)
at sun.applet.AppletPanel.run(AppletPanel.java:419)
at java.lang.Thread.run(Thread.java:619)
com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.checkClosed(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.checkClosed(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerResultSet.next(Unknown Source)
at Boom.MaakBoomStructuur(Boom.java:241)
at Boom.access$0(Boom.java:110)
at Boom$2.run(Boom.java:74)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
network: Connecting socket://192.168.5.4:1433 with proxy=DIRECT
network: Cache entry found [url: http://192.168.5.8/development/emiel/tagbis_dev/viewers/oqm%20viewer/system/organigram/organisatieschema.jar, version: null]





Now I've looked all over the web but nowhere can they offer any help, best I could find was a diffrent driver for MS-SQL which in version history says it was a bug and they fixed it..

**EDIT**
for some aditional info.. I never get these errors when using appletviewer, only when the applet gets started within browser

View Replies !   View Related
NullPointerException In JDBC V1.1 Driver
Hello,

 

We are deploying our application with the v1.1 JDBC driver, but are getting a little worried with some of the results of our recent stress tests.  I wanted to see if anyone could offer any insight into this problem.  Also, do you have any expectation for a release date for the 1.2 driver (not CTP).

 

Under heavy load with a number of concurrent processes loading to a few tables in our database through batched INSERT statements (called executeBatch against a prepared statement), we see these exceptions coming back from the driver:

 

com.vectorsgi.tw.services.exception.LoaderException: java.lang.NullPointerException
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:813)
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:482)
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:466)
 at com.vectorsgi.viex.workflow.capture.LoadListener.execute(LoadListener.java:91)
 at com.vectorsgi.viex.workflow.capture.LoadListener.actionFired(LoadListener.java:55)
 at fluximpl.JavaActionImpl.execute(JavaActionImpl.java:6)
 at fluximpl.gl.a(gl.java:348)
 at fluximpl.gl.b(gl.java:417)
 at fluximpl.gl.a(gl.java:236)
 at fluximpl.dm.d(dm.java:58)
 at fluximpl.tlb.run(tlb.java:10)
Caused by: java.lang.NullPointerException
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecuteBatchPreparedStatement(Unknown Source)
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementBatchExecutionRequest.executeStatement(Unknown Source)
 at com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
 at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(Unknown Source)
 at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadItems(X937HibernateLoader.java:1326)
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:637)
 ... 10 more


In a test of 20 "jobs" 2 failed with this error, so its certainly not frequent, but not fleeting either.  What is also strange about this is that after the two failures (not immediately back to back but within a few minutes of each other) we got a primary key constraint error:

 

com.vectorsgi.tw.services.exception.LoaderException: java.sql.BatchUpdateException: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__X937_ITEM__0E7B75BC'. Cannot insert duplicate key in object 'X937_ITEM'.
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:813)
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:482)
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:466)
 at com.vectorsgi.viex.workflow.capture.LoadListener.execute(LoadListener.java:91)
 at com.vectorsgi.viex.workflow.capture.LoadListener.actionFired(LoadListener.java:55)
 at fluximpl.JavaActionImpl.execute(JavaActionImpl.java:6)
 at fluximpl.gl.a(gl.java:348)
 at fluximpl.gl.b(gl.java:417)
 at fluximpl.gl.a(gl.java:236)
 at fluximpl.dm.d(dm.java:58)
 at fluximpl.tlb.run(tlb.java:10)
Caused by: java.sql.BatchUpdateException: com.microsoft.sqlserver.jdbc.SQLServerException: Violation of PRIMARY KEY constraint 'PK__X937_ITEM__0E7B75BC'. Cannot insert duplicate key in object 'X937_ITEM'.
 at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeBatch(Unknown Source)
 at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeBatch(NewProxyPreparedStatement.java:1723)
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadItems(X937HibernateLoader.java:1333)
 at com.vectorsgi.tw.loader.X937HibernateLoader.loadToDatabase(X937HibernateLoader.java:637)
 ... 10 more

 

Now- I realize that this is very straight forward, but we are almost certain that our key generation code cannot generate a duplicate key.  We have been running it 24x7 for three years at a number of customer sites without ever getting a duplicate (under the open-source jTDS driver).  Now that we are trying to move to a better driver that is actively supported, we see these primary key violations every once in a while.  Its very hard to consistently replicate, but we have received it from 5 of the past 20 stress tests.

 

I mainly want insight into the NullPointerException, but if there is any possibility that a driver issue could be contributing to my primary key problem--that would sure make a lot of sense.  (I realize its a long shot!)

 

Thanks,

 

Steve Ash

Software Developer

Metavante Image Solutions

View Replies !   View Related
JDBC And Temp Tables
I'm having trouble creating and using temp tables over JDBC. 


Actually, it's not so much creating as referring to a created table.  What appears to be happening is that the table is created and immediately dropped, so a subsequent statement cannot refer to the newly created table.


I've already done a lot of research and experimentation and found the selectMethod=cursor connection property.  Setting this property seems to have no effect.


Example queries:


1) select some.columns into #diffComp from some.table where .....
2) select * from #diffComp join foo on ......


The second query depends on the temp table #diffComp created by the first query.  When I trace this in Eclipse, the value returned by getUpdateCount() on the first query is the correct number of rows.  The second query is executed immediately aferwards, and ALWAYS throws :

com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name '#diffComp'.


I'm also able to look inside the connection objet in Eclipse, and can confirm that the activeConnectionProperties member DOES contain selectMethod=cursor.

Any suggestions?

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved