Oracle JDBC executeQuery() hanging with a to_char() in the select  
Author Message
christophersearle





PostPosted: 2003-11-19 23:58:00 Top

java-programmer, Oracle JDBC executeQuery() hanging with a to_char() in the select Calling statement.executeQuery() hangs, anyone experienced this? Using
the Oracle thin driver v9.2.0.1.0 running on a Solaris 8 box. The
code:

Connection connection = cdrDataSource.getConnection();
Statement statement = connection.createStatement();
String sql = "SELECT
TO_CHAR(SOFIXML.SOFI_LIB.SOFI_GET_XML('CA89352LAC42', NULL, NULL))
FROM DUAL";
ResultSet resultSet = statement.executeQuery(sql);
if(resultSet.next()) {
return resultSet.getString(1);
}

The SOFI_GET_XML function returns a CLOB and I'm using TO_CHAR() to
convert is into a VARCHAR2 for speed. Not doing a TO_CHAR and
processing the CLOB works fine but is a little slow. The query runs
fine through both TOAD and SQLPlus.

Thanks, Chris
 
Joe Weinstein





PostPosted: 2003-11-20 1:14:00 Top

java-programmer >> Oracle JDBC executeQuery() hanging with a to_char() in the select

Chris Searle wrote:

> Calling statement.executeQuery() hangs, anyone experienced this? Using
> the Oracle thin driver v9.2.0.1.0 running on a Solaris 8 box. The
> code:
>
> Connection connection = cdrDataSource.getConnection();
> Statement statement = connection.createStatement();
> String sql = "SELECT
> TO_CHAR(SOFIXML.SOFI_LIB.SOFI_GET_XML('CA89352LAC42', NULL, NULL))
> FROM DUAL";
> ResultSet resultSet = statement.executeQuery(sql);
> if(resultSet.next()) {
> return resultSet.getString(1);
> }
>
> The SOFI_GET_XML function returns a CLOB and I'm using TO_CHAR() to
> convert is into a VARCHAR2 for speed. Not doing a TO_CHAR and
> processing the CLOB works fine but is a little slow. The query runs
> fine through both TOAD and SQLPlus.

Very odd. What does the DBMS show this connection is doing? It may be
a driver/DBMS incompatibility where the driver thinks it's still
waiting for something from the DBMS, and the DBMS thinks the connection
is idle and has sent it all it is going to.
Joe Weinstein at BEA

>
> Thanks, Chris