Re: rsetMetaData.getColumnCount(); - Mailing list pgsql-jdbc

From sc0698
Subject Re: rsetMetaData.getColumnCount();
Date
Msg-id bk8pin$e6e$1@news.hub.org
Whole thread Raw
In response to rsetMetaData.getColumnCount();  ("sc0698" <sc0698@sina.com>)
Responses Re: rsetMetaData.getColumnCount();
List pgsql-jdbc
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;
  }



pgsql-jdbc by date:

Previous
From: "David Esposito"
Date:
Subject: JDBC Encoding conversion bug
Next
From: "David Esposito"
Date:
Subject: JDBC Encoding conversion bug