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 :
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.
My web application is running in jdk1.4, tomcat4, ms sql 2005 in win 2003 environment. I am using jdbc type 4 driver for sql server 2005 (com.microsoft.sqlserver.jdbc.SQLServerDriver, sqljdbc_1.2)database connection this gives an error even gives error in both sqljdbc1.1 and 1.2 versions...
1SELECT costct from costctmain where costct not in (select distinct mainct from costcts) 1 pageName : GENERAL_ERROR_PAGE select count(*) from ( select P1.type, SUM(CASE P1.costct WHEN '11234578' THEN P1.total ELSE 0 END) AS a11234578, sum(P1.total) w.project as type, e.costct, sum(t.tshours) as total from tswork t right outer join emp e on t.eid = e.eid join workmap w on t ct pp on w.project = pp.pno where tsstatus in ('appr','subt') and tsupload = 'y' and e.costct in (11234578) and tsdate >= (sel od where period = 'APR' and periodyear = 2007) group by e.costct, w.project union select PP.* from ( select t.jno as type, e.c s total from tsjob t right outer join emp e on t.eid = e.eid where tsstatus in ('appr','subt') and tsupload = 'y' and e.costct te >= (select startdate from period where period = 'APR' and periodyear = 2007) group by e.costct, t.jno ) as PP where type != y P1.type ) as P3 Error in executing query com.microsoft.sqlserver.jdbc.SQLServerException: The IOBuffer.process operation returned an unknown packet type:-120. Index:70. DS_DONE(-3) TDS_DONEPROC(-2) TDS_DONEINPROC(-1) at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.buildNextRowset(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.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.SQLServerStatement.executeQuery(Unknown Source) at eTime.DBConnectManager.execQuery(DBConnectManager.java:198) at reports.UtilisationReport.getData(UtilisationReport.java:333) at reports.UtilisationReport.generateReport(UtilisationReport.java:109) at reports.DivUtilisationReportServlet.getReportData(DivUtilisationReportServlet.java:230) at reports.DivUtilisationReportServlet.doGet(DivUtilisationReportServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:696) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) java.lang.NullPointerException at reports.UtilisationReport.getData(UtilisationReport.java:335) at reports.UtilisationReport.generateReport(UtilisationReport.java:109) at reports.DivUtilisationReportServlet.getReportData(DivUtilisationReportServlet.java:230) at reports.DivUtilisationReportServlet.doGet(DivUtilisationReportServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:696) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) select count(*) from ( select aatype as type, SUM(CASE P2.costct WHEN '11234578'THEN P2.total ELSE 0 END) AS a11234578, SUM(P2.t select aatype, costct, sum(tshours) as total from tsnr t join emp e on t.eid = e.eid where tsstatus in ('appr','subt') and tsup in ('11234578') and tsdate >= (select startdate from period where period = 'APR' and periodyear = 2007) group by aatype, costct ) as P3 Error in executing query com.microsoft.sqlserver.jdbc.SQLServerException: The IOBuffer.process operation returned an unknown packet type:-120. Index:70. DS_DONE(-3) TDS_DONEPROC(-2) TDS_DONEINPROC(-1) at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source) at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.buildNextRowset(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.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.SQLServerStatement.executeQuery(Unknown Source) at eTime.DBConnectManager.execQuery(DBConnectManager.java:198) at reports.UtilisationReport.getData(UtilisationReport.java:333) at reports.UtilisationReport.generateReport(UtilisationReport.java:133) at reports.DivUtilisationReportServlet.getReportData(DivUtilisationReportServlet.java:230) at reports.DivUtilisationReportServlet.doGet(DivUtilisationReportServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:696) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534) java.lang.NullPointerException at reports.UtilisationReport.getData(UtilisationReport.java:335) at reports.UtilisationReport.generateReport(UtilisationReport.java:133) at reports.DivUtilisationReportServlet.getReportData(DivUtilisationReportServlet.java:230) at reports.DivUtilisationReportServlet.doGet(DivUtilisationReportServlet.java:62) at javax.servlet.http.HttpServlet.service(HttpServlet.java:696) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:138) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2459) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:132) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:593) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:126) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:595) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:432) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:954) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:534)
end of tomcat server error ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
but when i use sql server 2000 driver jdbc ("sun.jdbc.odbc.JdbcOdbcDriver"), It works fine but i need to use type 4 driver please help me to fix this issue.
im stuck and despirately need help. my jdbc driver for mssql server 2000 (dont laugh).
here's the code:
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); Connection con = DriverManager.getConnection("jdbc:microsoftqlserver://user:1433");
and here's the exception it throws at me:
Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source) at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source) at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source) at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source) at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:207) at jdbctest.NewClass.main(NewClass.java:29)
i know this is a very common question for a thread, but u gotta pls answer me.
Anyone know what I'm doing wrong? My JDBC is erroring. I'm using the Microsoft 1.2 driver, I have a SQL Server 2005 back end with the following clients connecting to it:
ASP.NET 2.0 web application Visual Studio C# console applications (*2) Java command line client.
Everything runs hunky-dory on my dev. environment (laptop, local, launched via Visual Studio) but now it's on the server, the Java client is erroring.
When I use the 1.2 sqljdbc.jar file, I get:
25-Jan-2008 12:20:29 com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin WARNING: ConnectionID:1 TransactionID:0x0000000000000000 Prelogin response packet not marked as a REPLY
My Error Trap: -------------- SQL STATE : 08S01 ERROR CODE: 0 MESSAGE : The TDS protocol stream is not valid.
When I use the 1.1 file I get:
My Error Trap: -------------- SQL STATE : 08S01 ERROR CODE: 0 MESSAGE : The TDS prelogin response is incomplete. The target server must be SQL Server 2000 or later.
I don't know what these errors mean. I've tried compiling as java 1.5 and 1.6 with the same results. It works fine on my laptop (Vista Home Premium) but won't when I try and connect to the server. I've searched the web on the error messages and can't find an answer yet.
Any help appreciated.
My drivers are the Windows versions. Also, everything else is working okay on the server: The consoles are up and running and the web browser connects and SELECTs, UPDATEs & INSERTs okay. I ought to mention: My laptop is running SQL Server Development edition and the Server is running obviously something else.
My SQL Server version is 9.0.1399 and the OS is Windows Server 2003. SQL Authentication is mixed mode.
The javadoc for statement.setMaxRows(maxROWS) reads:
"Sets the limit for the maximum number of rows that any ResultSet object can contain to the given number. If the limit is exceeded, the excess rows are silently dropped."
In fact, it seems that the driver calls set rowcount MAXROWS on the connection.
While this superficially will work, if your query manipulates records sets that exceed MAXROWS, the subqueries will also be limited in their size. And this is not what you expect. The javadocs suggest that it is only the result that is truncated. Silently.
It seems that setFetchSize is more appropriate.
I am using a relatively recent jar (248KB).
I hope that somebody finds this useful and that the development team will adjust the javadocs or the behavior.
while (resultSet.next()) { System.out.println(resultSet.getDate("end_date")); }
The date field is nullable, and the records in the database are currently null. But when I run this program, I get the following exception when using version 1.2 of the MS JDBC Driver:
com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from int to DATE is unsupported. 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.getDate(Unknown Source) at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getDate(Unknown Source) at jdbc.main(jdbc.java:38) Exception in thread "main"
This started happening when we upgraded to the new driver. Any ideas why?
We are in the process of configuring a j2ee application with SQL Server 2005. We have downloaded the new version of SQL Server 2005 Java Database Connectivity (JDBC) Driver 1.0.
We are having some issues in getting it to work using the XA datasource. Description of the error is as follows:
javax.transaction.xa.XAException: java.sql.SQLException: Failed to create the XA control connection. Error: Could not find stored procedure 'master..xp_sqljdbc_xa_init'.. at com.microsoft.sqlserver.jdbc.SQLServerXAResource.start(Unknown Source)
Has anyone else has encountered this and possibly found a solution.
I'm trying to configure JBoss application server to use SQLServer 2005 as database with XA transactions. I can start a new transaction, access SQLServer from within the transaction, but when committing, there is the following XAException from SQLServer: 16:04:20,926 INFO [STDOUT] javax.transaction.xa.XAException: java.sql.SQLException: COMMIT: Status:0 msg:*** SQLJDBC_XA DTC_ERROR Context: xa_commit, state=1, StatusCode:-4 (0xFFFFFFFC) ***16:04:20,926 INFO [STDOUT] at com.microsoft.sqlserver.jdbc.SQLServerXAResource.commit(Unknown Source)16:04:20,941 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.commit(XAManagedConnection.java:176)16:04:20,941 INFO [STDOUT] at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:641)16:04:20,941 INFO [STDOUT] at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2619)16:04:20,941 INFO [STDOUT] at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1779) [...]
The system is running on Windows Server 2003 64bit with SQLServer 2005 64bit, and JBoss running on JDK 1.5.0 (32bit) Can anyone tell me what this message indicates?
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/"
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
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?
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
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"?
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?
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)
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?
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?
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!)
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
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?
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?
We are in need of a JDBC driver (version 3) to support some autonumbering in SQLServer. We've found a couple, very expensive stuff (JTurbo & DataDirect), these drivers can be more expensive than a SQLServer license. Any other ideas/sources?
Hello JoeOver the past several years, I have found your responses to jdbcusage/driver related issues to be extremely helpful. I am sure thatyou're very busy so I will make my question as brief as possible - thereason I didn't post this to a newsgroup is that I don't want to hearany more hype or links to benchmarks (since the vast majority of thebenchmarks don't test concurent/mixed-transaction environments). (I amalso posting a modified version of this message to some newsgroups, butbased on past responses - don't have too much hope that these will leadto a resolution.) If the only way to answer this question would be tohave a phone conversation, my company would be more than happy to pay aconsulting-service fee for your time.My situation:My company has a enterprise level web-app that targets SQL Server. Wedon't use J2EE - so we stick to a simple to administer web containers(JRun,Tomcat). Recently, we have been getting worse and worseperformance from our jdbc driver (we use the free MS jdbc driver) -things like strange transaction resource handling, chopy overallperformance, etc.. I have spent significant time tweaking it (followingvarious advice - many times yours - on newgroups... I can go intodetails, but I don't want to take up your time). As the project'sarchitect, I need to do something about this problem - but varioushigh-level tunnings that I have done to the way we use connections withthis driver haven't significantly improved perfomance under normaleveryday load. (Our queries often span tables with millions of records,and are relatively dynamic. We use a seperate pool of autocommit-offconnections for writes, and autocommit-on connecions for reads)So, then, my question - in your expert opinion - what is the BESTdriver from SQL Server 2000 given the following needs:Things I need it to have are solid jdbc 1.0, solid transactionhandling, decent concurrent load handling, stable implementation ofresource handling (i.e. auto closing result sets when parent statementsclose, closing of result sets & statements when connections close) andsupport for multiple open statements/result sets per connection.Things I do not have a direct need for:Connection Pooling (I keep my own pool of open connections), DataSourcesupport, distributed transactions or 2-phase commit support, RowSetvariants, jdbc 3.0 autokey generation, J2EE compliance. We do make useof updatable result sets - but I don't care if it isn't supported sinceI can still use MS driver for those, as they are mainly done it batchjobs).Things that are nice:It would also be good to have a driver that can handle prep statementcaching on a driver level (vs connection level) although this isn't anecessity, and if it is available - it would need to have aconfigurable caching strategy (or have a way to be turned off :)I very much appreciate your help in advanceThanksGary BogachkovSystem ArchitectStericycle Direct Return
Dear All,I developed an web application which use MS SQL Server 2000. Iencounter the following SQLException "[Microsoft][SQLServer 2000Driver for JDBC]Error setting up static cursor cache". Did anyoneencounter this problem before? What does this exception mean and howto solve this problem?[Remarks: The web application work properly on development machine andthis machine but encounter this exception when move to anothermachine, so is this exception related to the machine?]Thank you for your attention.Yours faithfully,Benny