[SQLServer 2000 Driver For JDBC] Must Declare The Variable '@P2GROUP'

May 6, 2008

Hello,I am working with the driver JDBC and I have a strange error that I can't find in Google for example.Caused by: com.seeburger.smarti.util.SmartiEJBException: nested exception is: com.seeburger.smarti.dao.DAOSysException: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Must declare the variable '@P2GROUP'.I don't know what is this variable '@P2GROUP'.Does anybody know it ?Thanks

View 2 Replies


ADVERTISEMENT

Cannot Load JDBC Driver Class 'com.microsoft.jdbc.sqlserver.SQLServerDriver'

Apr 14, 2008

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 17 Replies View Related

Problem With Two Consecutive Calls To CallableStatement (jdbc Driver 1.1, SQLServer 2005)

Nov 28, 2006

Hi,

I'm getting an error when I make two calls to a stored procedure (which I didn't use to).

This is an example:

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

public class Main {

public Main() {
Connection sproc_con;
try {

sproc_con = getConnection();
CallableStatement sproc_stmt = sproc_con.prepareCall("{call getID(?)}");

for (int i = 0; i < 2; i++) {
int id = getID("Test", sproc_stmt);
System.out.println(id);
}

sproc_stmt.close();
sproc_con.close();


} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (SQLException ex) {
ex.printStackTrace();
}

}

private int getID(String tableName, CallableStatement sproc_stmt) {

ResultSet rs = null;
int ID = 0;

try {

sproc_stmt.setString(1, tableName);
rs = sproc_stmt.executeQuery();
if (rs.next())
ID = rs.getInt(1);

} catch (SQLException sqle) {
sqle.printStackTrace();
System.exit(1);
} finally {
try {
if (rs != null)
rs.close();
} catch (SQLException sqle) {
sqle.printStackTrace();
}

return ID;
}
}

private Connection getConnection() throws ClassNotFoundException, SQLException {

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
return DriverManager.getConnection("jdbc:sqlserver://myserver:1433;DatabaseName=TestDB", "sa", "");

}

public static void main(String[] args) {
new Main();
}

}


The first call is ok, but the second throws an exception at sproc_stmt.executeQuery(); which says:

com.microsoft.sqlserver.jdbc.SQLServerException: Server failed to resume the transaction, desc: 3600000001.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.getPrepExecResponse(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PreparedStatementExecutionRequest.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.executeQuery(Unknown Source)
at javaapplication2.Main.getID(Main.java:53)
at javaapplication2.Main.<init>(Main.java:33)
at javaapplication2.Main.main(Main.java:85)


Am I doing something wrong or is this a bug?

I'm running on Win2003 with SQL Server 2005 Developer edition.



Thanks

/Niclas

View 1 Replies View Related

JDBC Sample Code Using Named Pipe And SQLServer 2005 Driver?

Nov 22, 2006

Hi,

Does anybody have a working Java code sample that connects to an SQLServer 2005 database on a remote host, via the default named pipe, from a client using the SQLServer 2005 JDBC driver? Could you post it, or a pointer to it?

I've gotten java.sql DriverManager.getConnection() to work fine with TCP/IP connections before. But I'm a newbie with named pipes, and unclear on how the connection string/properties are different. I've tried to piece it together from multiple docs and threads, but haven't found sample code that quite fits my situation. I think a simple working example would best clarify the syntax.

The server is not using SQL Express. Most SQLServer configuration options are defaults; the named pipes protocol is enabled.

Thanks

View 3 Replies View Related

Sending Table Variable Argument Using MSFT JDBC Driver

Nov 21, 2006



I want to call a stored procedure that has a table variable as its parameter. I am using the MSFT SQL Server 2005 JDBC driver 1.1, however I don't know how to construct a table variable from the Java side to place within a CallableStatement. The CallableStatement interface allows me to set various types of parameters (e.g. Boolean, Byte, Blob, Array, etc.) but I don't see anything for table variable.

Is there a way to do this?

View 3 Replies View Related

Sending Table Variable Argument Using MSFT JDBC Driver

Nov 20, 2006

Hi. I want to call a stored procedure that has a table variable as its parameter. I am using the MSFT SQL Server 2005 JDBC driver 1.1, however I don't know how to construct a table variable from the Java side to place within a CallableStatement. The CallableStatement interface allows me to set various types of parameters (e.g. Boolean, Byte, Blob, Array, etc.) but I don't see anything for table variable.

Is there a way to do this?

View 7 Replies View Related

SQLServer Declare New Variable Based On Another Variables Value

Oct 26, 2005

Hi, I'm a complete newbie to SQLServer and t-sql generally. What I want to do is create a new variable in a stored procedure based upon the value of another variable.

eg in the loop below I want to create 10 new variables, called @var0,@var1,@var2 ...@var9



declare @varname nvarchar(10)
declare @i integer

select @i=0

while @i<10
begin
set @varname = cast(('@var'+cast(@i as char)) as nvarchar(10))
set @i=@i+1
end

Does anyone know of a way to do this?

View 6 Replies View Related

Where To Get JDBC Driver For SQL Server 2000?

May 13, 2004

I have SQL server installed on a XP box. I need to access it from other machines using Java code. Where can I download a JDBC driver?
Thanks.

View 6 Replies View Related

SQLServer 2005 JDBC Driver - Date Rendered Correctly On Local Environment(windows), But Not On Websphere Server (unix)

Dec 6, 2006

Hi,

We are trying to move our application from SQL2005 to SQL2005, we are using 2005 jdbc driver 1.1.

The problem we have is, when a date is retrieved from the database, only the year part got correctly, but the date is automatically set to January 1 of that year. The interesting thing is this problem doesn't occur on local development environment (developer's windows platform), it only happens when we deploy the application to production server (unix).

Does anyone know what is going on, how to fix it?

Thanks.

Cathie

View 12 Replies View Related

MS SQL Server 2000 JDBC Driver SetDate() Bug Report

Apr 5, 2004

Hi,

Recently, I found a bug in Microsoft's official SQL Server2000 JDBC driver.
It seemed to lie in the Statement's setDate() method. Maybe they simply assumed
all date are represented in 12-hours format.
The test code is below:


public void testMisc() throws Exception {
Connection conn = TransactionManager.getConnection();
String sql = "select count(salescheck0_.ID) as x0_0_ " +
"from T_CHK_OUT_BILL_TEST salescheck0_ " +
"where (salescheck0_.EX_TIME>?)" +
"and(salescheck0_.EX_TIME<?)";
PreparedStatement stmt = conn.prepareCall(sql);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date timefrom = sdf.parse("2004-04-02 00:00:00.000");
Date timeto = sdf.parse("2004-04-02 23:00:00.000");

stmt.setDate(1, new java.sql.Date(timefrom.getTime()));
stmt.setDate(2, new java.sql.Date(timeto.getTime()));
// stmt.setString(1, "2004-04-02 00:00:00.000" );
// stmt.setString(2, "2004-04-02 23:59:59.000" );
ResultSet rs = stmt.executeQuery();
if(rs.next()) {
int count = rs.getInt(1);
System.out.println("count = " + count);
}
}

The test data is following:
ID, SO_ID,WH_ID,CLIENT_ID,CODE,OPERATOR,CHK_OUT_TIME, STATUS,CREATE_TIME,DELIVER_TYPE
86179,67521,1,661,SLCCK200404020016,xuwei,2004-4-2 12:15,20,2004-4-2 9:40,10
86229,67566,1,118,SLCCK200404020066,xuwei,2004-4-2 12:23,20,2004-4-2 9:41,10
86231,67568,1,130,SLCCK200404020068,xuwei,2004-4-2 12:23,20,2004-4-2 9:41,10
86232,67569,1,134,SLCCK200404020069,xuyili,2004-4-2 11:08,20,2004-4-2 9:41,10
86233,67571,1,151,SLCCK200404020070,xuwei,2004-4-2 12:23,20,2004-4-2 9:41,10
86234,67572,1,55,SLCCK200404020071,xuwei,2004-4-2 12:23,20,2004-4-2 9:41,10
86235,67573,1,71,SLCCK200404020072,xuwei,2004-4-2 12:23,20,2004-4-2 9:41,10
86252,67590,1,298,SLCCK200404020089,xuwei,2004-4-2 12:33,20,2004-4-2 9:41,10
86268,67576,1,25,SLCCK200404020105,xuwei,2004-4-2 12:23,20,2004-4-2 10:18,10
86269,67588,1,271,SLCCK200404020106,xuwei,2004-4-2 12:33,20,2004-4-2 10:20,10
86270,67506,1,42,SLCCK200404020107,xuwei,2004-4-2 12:15,20,2004-4-2 10:21,10
86271,67531,1,751,SLCCK200404020108,xuyili,2004-4-2 11:28,20,2004-4-2 10:22,10
86272,67570,1,149,SLCCK200404020109,xuwei,2004-4-2 12:23,20,2004-4-2 10:29,10
86273,67600,1,6,SLCCK200404020110,xuwei,2004-4-2 12:15,20,2004-4-2 10:40,10
86373,67665,3,686,SLCCK200404020210,root,2004-4-2 17:18,20,2004-4-2 16:32,10
86374,67657,3,883,SLCCK200404020211,root,2004-4-2 17:18,20,2004-4-2 16:32,10
86375,67666,3,686,SLCCK200404020212,root,2004-4-2 17:18,20,2004-4-2 16:32,10
86376,54799,1,395,SLCCK200404020213,zhouliyi,2004-4-2 19:52,20,2004-4-2 19:51,10
86377,55383,1,341,SLCCK200404020214,zhoulingyi,200 4-4-2 19:52,20,2004-4-2 19:51,10

Given the code and data, the expected output ought to be "count = 19"
But it's "count = 19" instead.
However, if you set date by using alternative method like the commented statements,
you can get the correct result.


Does anybody know if there exists any patch?
Could we expect Mircosoft to fix this bug? If so, where could I submit this bug report?

Regards,
Justin

View 3 Replies View Related

Problem With MSSQL SPRINTA 2000 JDBC Driver

Jul 20, 2005

Hi,I have installed MQ SQL Server 2000 on my laptop and trying to useSPRINTA 2000 JDBC Driver (inetmssql.jar) to connect to the local db. Iwrote a sample Java app to test the connection and I get the followingerror trace,DriverManager.initialize: jdbc.drivers = nullJDBC DriverManager initializedSQLException: SQLState(08S01){sql7=true, port=1433, user=sa, url=jdbc:inetdae7:US0211737-WP01:1433,password=wasfe, host=US0211737-WP01}getConnection failed: com.inet.tds.SQLException: Connection refused:connectcom.inet.tds.SQLException: Connection refused: connectjava.net.ConnectException: Connection refused: connectat java.net.PlainSocketImpl.socketConnect(Native Method)at java.net.PlainSocketImpl.doConnect(Unknown Source)at java.net.PlainSocketImpl.connectToAddress(Unknown Source)at java.net.PlainSocketImpl.connect(Unknown Source)at java.net.Socket.connect(Unknown Source)at java.net.Socket.connect(Unknown Source)at java.net.Socket.<init>(Unknown Source)at java.net.Socket.<init>(Unknown Source)at com.inet.tds.TdsDriver.a(Unknown Source)at com.inet.tds.TdsDriver.run(Unknown Source)at java.lang.Thread.run(Unknown Source)I tried searching the web and product doc. Nothing seems to help me.Has anyone come across similiar problems? Any pointers will beappreciated also.Thanks,Swami.

View 6 Replies View Related

Using 2005 JDBC Driver To Access SQL Server 2000

Oct 5, 2006

Hi,

I'm using JDBC driver for Server 2005 (version 1.1.1501) to access Server 2000. I have no problems reading my data, but every update returns "Cursor is READ ONLY".

If I use driver for Server 2000 I have no problems. And I have no problems running the same program with 2005 driver against SQL Server Express.

Where should I start debugging?

Thank you,

View 1 Replies View Related

SQL 2000 Padding Char With Spaces For A Type 4 JDBC Driver

Jul 20, 2005

Please help!!!We had a sql server 7 DB, with a char 8 field, in which some of thedata was only 7 characters in length.Via a type 4 JDBC driver, we got back a NON space padded String.This server got upgraded to sql server 2000. Now, via the type 4 JDBCdriver, we get a String padded field!!I understand there is a ODBC setting for ANSI padding on/off, but thetype 4 doesn;t use the OdBC-JDBC bridge...so configuration could beaffecting the data coming back?No one here can work out why. Any ideas?

View 1 Replies View Related

SQLServer 2000 JDBC /SQL Exception Error Messages - Meaning?

Jul 20, 2005

Hi;I went to the microsoft site to try to find a guide to the errormessages that the jdbc drivers give ( for sqlserver 2000 ).I had no luck.Does anyone know if there is such a guide?I got this mysterious error message below in my logs ( nothing visiblein user land ).Anyone know what it means?Thanks in advanceStevejava.sql.SQLException: [Microsoft][SQLServer 2000 Driver forJDBC][SQLServer]Transaction (Process ID 151) was deadlocked on lockresources with another process and has been chosen as the deadlockvictim. Rerun the transaction.

View 5 Replies View Related

Transaction Left In Open State On SQLServer 2000 And JDBC

Sep 6, 2007

I have a problem where my connection always has an open transaction as viewed by activity monitor.

I am using the latest MS SQL Server 2005 JDBC driver (1.1) and connecting to SQL Server 2000.

This issue arises only when selectMethod=cursor and autoCommit is set to false. This issue does not exist when I connect to SQL Server 2005.

Has anyone else seen this issue?
How can this issue be resolved?

Thanks

Peter

View 3 Replies View Related

MS JDBC Driver Incompatibility With JDBC 3.0 Specs

Aug 8, 2006

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 1 Replies View Related

MS SQL Server JDBC Driver Type 2 And Driver Type 4 Differences

Jul 20, 2005

Hi,Could some please tell me whether Microsoft provides Type 2 and Type 4jdbc driver ? For Type 4 MS providescom.microsoft.jdbc.sqlserver.SQLServerDriver driver. What is thecofiguration required for type 2 driver and what driver class filesrequired ?Its very urgent to me please reply.Ajay

View 1 Replies View Related

JDBC Driver

Feb 6, 2004

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 1 Replies View Related

Need JDBC Driver For MS SQL 7.00.847

Jun 1, 2004

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 1 Replies View Related

JDBC Driver?

Dec 7, 2004

Hi,

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

Rgds and thanks, PP

View 3 Replies View Related

JDBC Driver For MS SQL 7

Mar 8, 2006

Hi guys,

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

Thank you.

View 3 Replies View Related

Help With JDBC Driver

Jul 23, 2005

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 2 Replies View Related

Need A JDBC Driver

Jul 20, 2005

I need a free, redistributable JDBC driverfrom MS SQL Server. (MSDE2000a)

View 2 Replies View Related

Jdbc Driver

Oct 2, 2006

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 3 Replies View Related

Driver Jdbc

Nov 19, 2007

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 1 Replies View Related

I NEED THE JDBC DRIVER FOR MS SQL SERVER

Jan 18, 2001

please help it's urgent i badly need the jdbc driver for mssql for my project
thank u

View 1 Replies View Related

Sql Server Jdbc Driver

Jan 18, 2005

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 2 Replies View Related

Weblogic JDBC Driver And SQL

Mar 30, 2004

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 2 Replies View Related

JDBC 1.2 Driver BigDecimal Bug

Feb 1, 2008

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 6 Replies View Related

Can't Get IntegratedSecurity With JDBC Driver

Oct 7, 2006

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 33 Replies View Related

NullPointerException In JDBC V1.1 Driver

Jun 20, 2007

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 5 Replies View Related

JDBC Driver Vs ODBC?

Mar 21, 2008

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 8 Replies View Related

Cannot Find The Driver For JDBC

Jan 30, 2006

Hi all, I am building a program using Java and SQL express and I need the driver in order to connect to the database. I have downloaded I think a version for sql server 2005 but it did not work. Can somebody tell me if such driver exists?



Thank you all

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved