Java with PL/SQL
From: Tatiane <tnobre_at_i9.net>
Date: 19 Jun 2002 11:49:53 -0700
Message-ID: <67406b1f.0206191049.13699df2_at_posting.google.com>
return numReg;
}
}
Received on Wed Jun 19 2002 - 20:49:53 CEST
Date: 19 Jun 2002 11:49:53 -0700
Message-ID: <67406b1f.0206191049.13699df2_at_posting.google.com>
I'm trying to call a proc with a java class in pl/sql, but i always
get this error:"ORA - 29531:no method <method name> in class <class
name>".
I dont know what is happening because de .java is like this:
package xxxx;
import java.sql.*;
import java.io.*;
import oracle.jdbc.driver.*;
public class DbContaRegistro {
public static final String NOME_TABELA = "TEMPO";
}
public static int obtemQuantReg() throws SQLException {
Connection conn =
DriverManager.getConnection("jdbc:default:connection:");
String sql = "SELECT COUNT(*) FROM " + NOME_TABELA;
int numReg = 0;
try {
Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(sql); while (rs.next()) { numReg = rs.getInt(1); } rs.close(); stmt.close(); } catch (SQLException e) { System.err.println(e.getMessage());}
return numReg;
}
}
Received on Wed Jun 19 2002 - 20:49:53 CEST