OutOfMemoryError With SQL Server 2005 V1.2 JDBC Driver
Oct 6, 2007
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.
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?
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?
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 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.
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?
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).
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)?
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/"
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.
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.