SQL Server 2005 JDBC Driver 1.1 Error In Using XA Datasource
Sep 11, 2007
Hello,
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?
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 figure out if the SQL Server 2005 JDBC driver supports SSL at all. I've downloaded the driver documentation, looked at more web pages than I care to count, and even went as far as to take a stab at guessing at different driver property names in the hopes I might discover some undocumented feature. Each time I try, I come up dry.
The following exception shows up in my JBoss log:
2007-01-03 12:13:36,812 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection: null org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (com.microsoft.sqlserver.jdbc.SQLServerException: The SQL Server login requires an SSL connection.)
I know I have things working properly on the SQL Server side, as both osql and Query Analyzer work fine, and packet sniffing yields no plain text information. I've also tried swapping in the open source JTDS driver, and once again, sniffing shows that the data between the two machines in encrypted.
Does anyone know if I'm just missing something completely obvious, or can someone state with absolute certainty that the driver does not support SSL? Any ideas on how to find out if there are plans to support this feature and what the timeline might be?
Do we have to use SQL server 2005 JDBC driver to connect the sql server 2005? I got sql server 2000 driver for JDBC, it works fine to connect the database. But when I use sql server migration assistant for oracle, i got an error saying: [sql server 2000 driver for JDBC] Error establishing socket. Do I have to download SQL server 2005 driver for JDBC or I miss something else?
Can any version of the SQL Server 2000 JDBC driver connect to SQL Server 2005 or do I have to install the new JDBC version 1.1 to connect to my 2005 instance?
I have one query which executes properly with mssql 2000 jdbc driver but fails with the 2005 driver.
The query creates a table, using insert exec method tries to get the data in the created table. But, executing this statement fails producing exception com.microsoft.sqlserver.jdbc.SQLServerException: The statement did no t return a result set.
the command is as: insert into #temp exec ('dbcc inputbuffer (' + @spid + ')')
I tried executing only the dbcc command on the db with query analyzer, it returns the results correctly, even with the same driver if I execute the dbcc query it runs fine and returns the resultset. But, only when I use it with insert exec it fails.
Does anyone know why this error occurs and what can be work-around.
Tengo instalado Microsoft Windows 2003 Server Standard Edition en un servidor IBM xSeries 220, estoy tratando de instalar IBM Director 5.10 y no ha sido posible hacer que se conecte con la base de datos.
Esto ocurre cuando intento configurar el Servidor SQL en la fase final de la instalación de IBM Director.
Gracias por su ayuda, ¿puede alguien darme alguna sugerencia?
We have a problem with SQL Server 2005 v1.2 JDBC driver, where the application is failing with java.lang.OutOfMemoryError. We have a database of around 50 milion rows and our application has to query that database and operate on the large dataset. However, we are not facing this problem with databases having 1 million rows.
Database is running fine even after the java.lang.OutOfMemoryError in the application side. However, the application is not responding after this error.
We are facing this problem with SQL Server 2005 Standard Edition as well as Enterprise Edition. Any help or suggestions will be highly appreciated.
Recently I downloaded version 1.2 release of the Microsoft SQL Server 2005 JDBC Driver. Thanks a ton to Microsoft for providing many new features such as Adaptive Buffering , SSL Encryption , Tightly Coupled XA Transactions etc.
I am mainly concerned about SSL part of it and would be grateful if you can solve my queries or forward it to app- ropriate forum.
1 ) I tried connecting to SSL enabled SQL Server 2005 through a sample program provided by Microsoft along with this package ( Version 1.2 ) and I succeeded whereas in previous versions I use to get an exception as "The SQL Server login requires an SSL connection." My connection string is as follows "jdbcqlserver://Ip adress of dataserver machine:1433;databaseName=master;user=sa;password=sapassword" .
Ideally we should only get an SSL connection when we request it else an error message should be thrown informing the user that dataserver requires an SSL connection. This would help in choosing between type of communication a user needs with dataserver.
The scenario now is like forcing a user to have SSL communication if dataserver forces it. A flag may be added as ssl should be mandatory or auto .
2 ) Current driver 1.2 is not capable of communicating with MS SQL Server 2000 both in case of SSL and Non - SSL cases , The error which we receive in both cases is :
Oct 18, 2007 4:57:17 PM com.microsoft.sqlserver.jdbc.SQLServerConnection Prelogin WARNING: ConnectionID:1 TransactionID:0x0000000000000000 Prelogin response packet not marked as EOM The TDS protocol stream is not valid.
To communicate with both MS SQL Server 2000 and 2005 a user will have to maintain both the drivers which may increase complexity of the application , like loading both driver in a single process , etc etc . . .
If version 1.2 id built on top of Sql server 2000 JDBC drive then it should be able to handle following 4 cases :
i ) SQL Server 2005 - SSL , ii ) SQL Server 2005 - Non - SSL , iii ) SQL Server 2000 - SSL , iv ) SQL Server 2000 - Non - SSL .
If this single driver handles all above 4 cases , life of a developer and application developed by him/her would become less complex.
3 ) Last but not the least , the SQL Server 2000 JDBC driver connects with both kind of SQL Server 2000 instances i.e. SSL and Non - SSL without any certificate of flags specified. I was able to establish non - SSL connection with SQL Server 2000 using two third party JDBC drivers which I think is not appropriate behaviour.
4 ) I have also noticed that when SQL Server 2005 is running in Non - SSL mode i.e. "ForecEncryption=No" and our Client application requests SSL communication , we are not warned about server is not runnning in SSL mode , could you please explain this ?
Kindly correct me I am wrong anywhere as I am just a beginner and don't have much knowledge on this subject .
I'm encountering a problem that seems to be due to the StreamError class not being serializable. This was raised on the JDBC Driver Team blog by Jonas on 10/24/2007. Jimmy Wu notes on 10/29/2007 that it is under investigation. Any progress?
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.
Hi, We are looking for a way to create the jdbc connection with Microsoft jdbc driver on a TomCat server ? Meaning the exact information to enter within the server.xml file or within the Tomcat web server administration tool - data source GUI.
I am using SQL server 2005 stored procedures being called from my java application using the CallableStatement. As long as my stored procedure is a simple and direct Select statement things are moving nicely. But my stored procedures are a little bit more complicated and this causes problems for me to parse the data in a ResultSet. a sample stored procedure: Create procedure sp_Get
//this also returns false? boolean moreResults = cmd.getMoreResults();
The strange part of this is that when you execute this query in the SQL Server Managent Studio it returns 1 result set. Why is my java code not able to see this result?
I have some code that should execute multiple statements and then commit. I am using the Microsoft SQL Server 2005 JDBC Driver 1.1.
The statements only commit ifI close the connection to the SQL Server 2005 instance. I've looked at the example given at http://msdn2.microsoft.com/en-us/library/ms378931.aspx and it doesn't require closing the connection in order to commit.
Example:
public void doCall(Connection con) { try { /*Turn off AutoCommit.*/ con.setAutoCommit(false);
I use the Microsoft SQL Server 2005 JDBC Driver (1.0.809.102 and 1.1.1320.0) to connect to a SQL Server 2005 database. I'm currently implementing a generic data access layer that executes an arbitrary SQL statement:
public void prepareQuery(String sql) throws SQLException, ClassNotFoundException { PreparedStatement stm = getConnection().prepareStatement(sql); ParameterMetaData pmd = stm.getParameterMetaData(); int numPar = pmd.getParameterCount(); System.out.println("Number of parameters: " + numPar); // ... acquire and process 'numPar' parameters ... }
Exemplarily, I created a table named 'TEST_TABLE' with three Integer columns ('C1', 'C2' and 'C3') and a Varchar column ('C4'). Calling
This is definitely wrong because that statement has only two parameters, one of type Integer and one of type Varchar. How can I get the correct number and types of the parameters?
I'm having an issue with the JDBC driver when I execute a stored procedure that both has a return value and also returns a result set. If I attempt to retrieve the return value (registered as an output parameter) after I execute the stored procedure, then any subsequent attempts to retrieve the result set always return null. Is this by design? If I use the result set first and then later get the return value that works; however, in my situation I need to first check the return value before I work on the result set. Am I'm I doing something wrong?
I am trying to configure distributed transaction and XA support using Microsoft SQL Server 2005 JDBC Driver. I have coppied SQLJDBC_XA.dll from XA directory and placed in my sql server binn directory and trying to run the script xa_install.sql from binn directory with command as below :
But I am getting error saying : [DBNETLIB]SQL Server does not exist or access denied. [DBNETLIB]ConnectionOpen (Connect()).
when I replaced local host with the machine name it gives error : [Shared Memory]SQL Server does not exist or access denied. [Shared Memory]ConnectionOpen (Connect()).
where in I am able to test connection from Websphere using the same connection.
Please help some one ....... I am in URGENT need.... I need to enable XA suport for my application to run........
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).
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.
I have a Tomcat server which uses the SQL 2005 JDBC Driver 1.1 .
A couple of weeks ago I successfully got it to work with database failover. However, I've now run in to another problem whereby it fails to failback i.e. the DB fails for a second time back to the original server.
If I restart the Tomcat server following a failback everything continues to work again. Or at least until I do another failover and failback!
It also doesn't seem to make any difference which DB server (primary or failoverPartner) is the principal when we perform a failover and failback ... It will always fails on the failback.
This also seems to be the case with the 1.2 CTP driver.
One of our customers is experiencing a problem that makes me think there is a network problem, because we make a request and never return from the driver, but the transaction is still open on the server awaiting the next command (and holding locks blocking other processes). I see a number of other driver writers have described similar problems, and their "workaround" is to set SO_TIMEOUT on the sockets (setSoTimeout) they create which is a last defense so that the transaction won't block forever.
I do not see this in the API documentation- how can I set this? Many other drivers use a connection string parameter, do you offer the same?
Is there any logging I can enable that can show me for sure that the driver is waiting indefinately on socket.read (thats not terribly expensive)?
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.