Hi,
when i use Netezza jdbc driver connect to Netezza database, i meet a problem
-------------------------------------------------------------------------------------------------
Connect to Netezza database by Netezza jdbc driver
Commit some sql
Disconnect Netezza database by Netezza jdbc driver(close the connection)
-------------------------------------------------------------------------------------------------
Above process is ok
But when I try to connect to Netezza database by Netezza jdbc driver for the second time in the same application, there is exception:
(I can get the second connection , the exception is on the con.execute method)
the detail message is: Driver can process one query at one time
the vendor code is :11403
what's wrong with my code
Thanks,
Frank
Frank,
Hard to tell exactly what you are hitting without your code, JDBC trace, nor rev of the driver.
That said, normally the error you are hitting is a result of attempting to execute more than one query simultaneously under the same connection instance. Specifically, one connection instance can execute single query at a time. This means, if one query is already under execution on a connection instance, you cannot send another query for execution at the same time.
Are you using multi-threading while using JDBC? If this is the case then, then this might be happening because your application is passing the same connection instance in multiple threads and some of the threads are trying to send queries for execution. Resolution is to disable multi-threading.
If this does not describe your issue, please open a Netezza support ticket as your specific use case may have exposed a defect in the driver. Perhaps it may have been resolved in a more recent build...
-Jeff
Jeff,
Thanks a lot for your response.
I use standard JDBC API, single thread to access Netezza. The Netezza build is (Release 4.6.2 (P-4) [Build 9909])
the sample code very simple:
---------------------------------------------------------------------------------------------------------
url = "jdbc:netezza://" + server + "/" + databaseName ;
Class.forName("org.netezza.Driver");
con = DriverManager.getConnection(url,user, password);
ps = con.prepareStatement(SQLStatementDefinitions.validateUDFName);
ps.execute(); ()// exception at here for the second time, SQLSTATE=HY014, it likes a "no more handler" problem.
-----------------------------------------------------------------------------------------------------------
But I'm sure I have closed PreparedStatement in the first connection.
We use similar code to access teradata (the only different are driver and URL),but do not meet this problem.
Is that Netezza build version is a limited version or we need change some settings in database such as MAXAPPLS in DB2?
Thanks,
Frank
Frank,
Best that you open a ticket with Netezza Support at this point to get your problem resolved.
-Jeff
Jeff,
Thanks, I have found a workaround for this problem,
when I use Statement to replace prepareStatement for a specific query, it works fine.
I'm not sure it's a defect of Netezza, I will do more investigation when I have enough time.
Thank,
Frank
