PL/SQL (MOSC)

MOSC Banner

Fetch java.sql.resultSet into PL Sql function return as sys_refcursor

edited Jan 27, 2020 8:58AM in PL/SQL (MOSC) 2 commentsAnswered

Hi All ,

I have created java program which connect using JDBC to remote database and return as resultSet to Oracle PL\ Sql function . Does it posible in java and PL Sql to fetch resultSet object in SYS_REFCURSOR? any other method to do same functionality?

Java Program

----------------

cat sqlExecution.java

import java.sql.*;

import oracle.jdbc.*;

import java.util.Properties;

import oracle.jdbc.pool.OracleDataSource;

public class sqlExecution  {

        String dbServiceName;

        String mySql;

        ResultSet rset=null;

        public ResultSet checkUserExists(String dbServiceName, String mySql)

        {

                this.dbServiceName=dbServiceName;

                this.mySql=mySql;

                try

                {

                DBRemoteConn dbRemoteConn = new DBRemoteConn();

                Connection dbConn = dbRemoteConn.makeConnection(dbServiceName);

                Statement stmt = dbConn.createStatement();

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center