Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> GATHER_SCHEMA_STATS from Java program

GATHER_SCHEMA_STATS from Java program

From: Christophe Bonte <chrbonte_at_hotmail.com>
Date: Thu, 31 Mar 2005 10:31:13 +0200
Message-ID: <424bb57a$0$329$4d4efb8e@news.be.uu.net>


Hello

I don't have much experience in stored procedures. I'm having some trouble. I'm creating a java program that would compute statistics from the current schema in the Oracle DB.

Here's the main code below



try {
 CallableStatement stmt = null;
 Connection con = null;
 String oracleUser = "CYBERLAB";
 con = ConnectionManager.getConnection();  if (con == null){
   throw new MipsNoConnectionAvailableException("No Connection", "Statistics.java");
}

 stmt = con.prepareCall("begin ? := dbms_stats.gather_schema_stats(?,?); end;");

 stmt.registerOutParameter(1, OracleTypes.CURSOR);
 stmt.setString(2, "ownname=> '" + oracleUser + "'");
 stmt.setString(3, "cascade=> TRUE");

  //stmt.setString("ownname", oracleUser);   //stmt.setBoolean("cascade", true);
  stmt.execute();

} catch (SQLException e) {

    ........
}


When I execute this I get the error

2005-03-31 09:26:59 ** - ** - ** New JDBC connection needed: driver name and version: Oracle JDBC driver 10.1.0.2.0, URL: jdbc:oracle:oci:@cyber10g_CYBERBASE
java.sql.SQLException: SQLException ORA-06550: line 1, column 13: PLS-00306: wrong number or types of arguments in call to 'GATHER_SCHEMA_STATS'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Does anyone have any idea what I'm doing wrong? Thanks in advance. Received on Thu Mar 31 2005 - 02:31:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US