JDBC Code Change From SQL Server to Oracle
        Posted  
        
            by BeginnerAmongBeginners
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by BeginnerAmongBeginners
        
        
        
        Published on 2010-05-25T17:08:43Z
        Indexed on 
            2010/05/25
            17:11 UTC
        
        
        Read the original article
        Hit count: 244
        
In the JDBC code, I have the following that is working with SQL Server:
CallableStatement stmt = connection.prepareCall("{ call getName() }");
ResultSet rs = stmt.executeQuery();
if(rs != null) {
while(rs.next()) {
//do something with rs.getString("name")
}
}
Multiple rows are returned for the above situation. I understand that the use of a cursor is required to loop through the table in Oracle, but is there any way to keep the above code the same and accomplish the same thing?
Thanks in advance.
© Stack Overflow or respective owner