Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. IN MY JDBC CODE EXCEPTION OCCURING ,procedure code is fine compiled & created ...exception isat oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1007) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleS

IN MY JDBC CODE EXCEPTION OCCURING ,procedure code is fine compiled & created ...exception isat oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1007) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleS

Scheduled Pinned Locked Moved Database
databasejavaoraclequestionannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LOKENDRA YADAV
    wrote on last edited by
    #1

    *************************my JDBC CODE ****************************** ***********using callable statement***************************** import A.JDBCUtil; import java.sql.*; import java.util.*; public class Test11 { public static void main(String[] args) { Connection con=null; CallableStatement cs=null; try{ int sid=96; con=JDBCUtil.getOracleConnection(); cs=con.prepareCall("call updateStudentData(?,?,?,?)"); cs.setInt(1,sid); cs.registerOutParameter(2,Types.INTEGER); cs.registerOutParameter(3,Types.FLOAT); cs.registerOutParameter(4,Types.CHAR); cs.execute(); System.out.println("procedure executed succesfully"); int t=cs.getInt(2); float a=cs.getFloat(3); String g=cs.getString(4); System.out.println("TOTAL"+t); System.out.println("average"+a); System.out.println("grade"+g); }catch(SQLException e){ System.out.println("EXCEPTION occur"); e.printStackTrace(); }finally{ JDBCUtil.cleanup(cs, con); } } } ************************my stored procedure code************************************************** create or replace procedure updateStudentData(id int,tot out int,ag out float,gd out char) as m1 number(3); m2 number(3); m3 number(3); begin select marks1,marks2,marks3 into m1,m2,m3 from students where sid=id; tot:=m1+m2+m3; ag:=tot/3; if (ag>=85.0) then gd:='A'; elsif(ag>=75.0)then gd:='B'; elsif(ag>=65.0)then gd:='C'; else gd:='D'; end if; update students set total=tot,average=ag,grade=gd where sid=id; end; /

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups