Re: rsetMetaData.getColumnCount();

From: Barry Lind <blind(at)xythos(dot)com>
To: sc0698 <sc0698(at)sina(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: rsetMetaData.getColumnCount();
Date: 2003-09-17 15:48:01
Message-ID: 3F688231.8060704@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Please send a test case that I can compile and run on my machine to
debug this problem. The code you included below doesn't even have the
call to getColumnCount().

thanks,
--Barry

sc0698 wrote:
> the jdbc driver version :
> 7.4beta3(build 209)(2003-09-12) JDBC3 JDK 1.4 includes support for SSL
>
> database verion:
> 7.4beta3 and 7.3.4
>
>
> In the create2DArray I want to use rsetMetaData.getColumnCount(),
>
>
> SQL.append("{?=call Fuc_Test4Query(");
> SQL.append("'"+name+"','"+value+"'");
> SQL.append(")}");
> m_query = SQL;
>
> public boolean executeProc() {
> boolean ret = false;
>
> Connection conn = null;
> CallableStatement cstmt = null;
>
> if ( (m_query != null) && !m_query.equals("")) {
> conn = getConnection();
>
> if (conn != null) {
> try {
> conn.setAutoCommit(false);
>
> cstmt = conn.prepareCall(m_query);
>
> if (m_flag.toUpperCase() != UPDATE) {
> cstmt.registerOutParameter(1, Types.OTHER);
> cstmt.execute();
>
> // ResultSet resultSet = cstmt.executeQuery();
>
> ResultSet resultSet = (ResultSet)cstmt.getObject(1);
>
> // org.postgresql.PGRefCursorResultSet refcurs
> // = (PGRefCursorResultSet) con.getObject(1);
> //String cursorName = refcurs.getRefCursor();
>
> //resultset to 2D Array
> m_twoDArray = create2DArray(resultSet);
>
> resultSet.close();
> }
> else {
> cstmt.registerOutParameter(1, Types.INTEGER);
> cstmt.execute();
> m_return = cstmt.getInt(1);
> }
>
> conn.commit();
>
> // close CallableStatement handle
> cstmt.close();
> conn.close();
>
> ret = true;
> }
> catch (SQLException e) {
> e.printStackTrace();
>
> try {
> if (cstmt != null) {
> cstmt.close();
> }
>
> conn.close();
> }
> catch (Exception se) {
> }
>
> throw new RuntimeException(e.getMessage());
> }
> }
> }
>
> return ret;
> }
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Ron 2003-09-17 19:12:28 Batch Processing - Autocommit
Previous Message Barry Lind 2003-09-17 15:44:06 Re: Stored Procedure returns a ResultSet