Skip to Main Content

Java and JavaScript in the Database

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

oracle fuction called from java not getting data from resultset

user13055307Dec 7 2023 — edited Dec 7 2023

ResultSet rs = null;
CallableStatement stmt = null;
List<TestObj> objList= new ArrayList<TestObj>();
try
{
stmt = con.prepareCall( "{? = call TEST_FUNCTION(?,?) }");
stmt.registerOutParameter( 1, Types.VARCHAR );
stmt.setString( 2, "A");
stmt.setString( 3, "B");
stmt.execute();
rs = stmt.getResultSet();
while( rs.next() )
{
TestObj obj= new TestObj ();
obj.setA( rs.getString( "TEST1" ) );
obj.setB( rs.getString( "TEST2" ) );
obj.setC( rs.getString( "TEST3" ) );
obj.setD( rs.getString( "TEST4" ) );
objList.add( obj);
}
}
catch( SQLException e )
{
e.printStackTrace();
}
finally
{
rs.close();
stmt.close();
}

    When run, it gives me a null point exception at 'rs.next()'. Can anyone please tell me how to access the return values from the function.

Note : Passing values to the function and executing the query works fine without any exceptions ( stmt.execute() run without any exceptions )

Comments

Answer

Yes. Async, semi-sync, and InnoDB Cluster.

Marked as Answer by 3602098 · Sep 27 2020
Basharat Hussain Oct 16 2024

Dear @dave-stokes-mysql-community-team-oracle

I am facing a problem please Guide me.

I have deployed two MySQL Nodes version 8. I am trying to async MySQL nodes, the replication complete successful as long as a user create or some action performed from the application. When an action is perform from the Application . On the slave node the following error occur.

Before an action perform from the Application everything working fine replication from master to slave working as expected.

Please Guide me.

Thank You in Advance.
Basharat Hussain.

L. Fernigrini Oct 16 2024

You are replying to a 5 year old “solved” thread with a new problem…Please do not hijack existing threads, open a new one with the appropriate details. I'm closing this one.

1 - 3

Post Details

Added on Dec 7 2023
4 comments
214 views