Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Invalid column index

843859Feb 26 2009 — edited Feb 26 2009
Hey i have the following code and it's giving this error ORA-17003: Invalid column index

this is my java code
	public void GetPersoon(String id) throws SQLException {

		String query= "{call usp_SnaxPersonen.usp_SelectPersoon(inPers_ID,results_cursor) }";

		CallableStatement stmt = conn.prepareCall(query);

		// set the in param
		stmt.setString("inPers_ID", id);

		// register the type of the out param - an Oracle specific type
		stmt.registerOutParameter("results_cursor", OracleTypes.CURSOR);

		// execute and retrieve the result set
		stmt.execute();
		ResultSet rs = (ResultSet)stmt.getObject(1);

		// print the results
		while (rs.next()) {
			System.out.println(rs.getString(1) );
		}

		rs.close();
		stmt.close();
	}
And my sql procedure
CREATE OR REPLACE PACKAGE BODY usp_SnaxPersonen
AS
PROCEDURE usp_SelectPersoon(inPers_ID IN VARCHAR2,results_cursor OUT CURSOR_TYPE)
	AS
	BEGIN
		OPEN results_cursor FOR
			SELECT  Personen.PersoonId,Personen.Naam,Personen.Voornaam ,Personen.Adres,Personen.Postcode,Gemeenten.Gemeente,Personen.Twitter,Personen.Leerkracht,Personen.Geboortedatum,Personen.KlasId,Personen.Picture
			FROM Personen,Gemeenten
			WHERE PersoonID = inPers_id;
	END;
Can somebody help me the procedure works in vb.net but nog in java ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2009
Added on Feb 26 2009
1 comment
479 views