Re: Java Stored Procedure

From: Ghislain Gadbois <Ghislain.Gadbois_at_sisca.com>
Date: 2000/04/15
Message-ID: <EN%J4.739$mF4.34966_at_wagner.videotron.net>#1/1


Make sure all the Java packages are correctly installed in your Oracle 8i database.

HTH "Dennis Sandlin" <dsandlin_at_mitre.org> a écrit dans le message news: 38F72BF4.1EAD2CA_at_mitre.org...
> Hi,
>
> I'm new to both Java and Oracle, but I'm trying to work with Java stored
> procedures anyway. I wrote a simple java class heavily based off an
> example in the Oracle documentation. I was able to successfully compile
> the ".java" file to create the ".class" file. I then try to load the
> ".class" file using the following command:
> loadjava -user name/passwd -v -resolve Prac.class
>
> This returns the following:
> initialization complete
> resolver :
> Error while resolving class Prac
> ORA-00904: invalid column name
>
> loadjav: 1 errors
>
> The message as well as the error code indicate a reference to an invalid
> column, however, I don't even reference a column by name. Here's the
> java class:
>
> import java.sql.*;
> import java.io.*;
> import oracle.jdbc.driver.*;
>
> public class Prac {
> public static void addPrac(String first, String last, int age)
> throws SQLException {
> String sql = "INSERT INTO den_t VALUES (?,?,?)";
> try {
> Connection conn = new OracleDriver().defaultConnection();
> PreparedStatement pstmt = conn.prepareStatement(sql);
> pstmt.setString(1, first);
> pstmt.setString(2, last);
> pstmt.setInt(3, age);
> pstmt.executeUpdate();
> pstmt.close();
> } catch (SQLException e) {System.err.println(e.getMessage());}
> }
> }
>
> For the record, this is what den_t looks like:
>
> SQL> describe den_t
> Name Null? Type
> ----------------------------------------------------- --------
> ------------------------------------
> FIRST_NAME
> VARCHAR2(20)
> LAST_NAME
> VARCHAR2(20)
> AGE
> NUMBER(3)
>
> SQL> spool off
>
> Any help will be greatly appreciated.
>
> Thanks in advance!
Received on Sat Apr 15 2000 - 00:00:00 CEST

Original text of this message