学了java很久了, 一直没用过存储过程来对数据库进行操作,请大家给几个例子吧,我学习一下。谢谢啦

解决方案 »

  1.   

    百度下 很多 和JDBC方式差不多public class ProcessPoetDeaths{ 
    public abstract void sendDeath(String name, int age); 

    static void mapEarlyDeaths(ProcessPoetDeaths mapper){ 
    Connection con = null; 
    CallableStatement toesUp = null; 
    try { 
    con = ConnectionPool.getConnection(); 
    con.setAutoCommit(false); 
    CallableStatement toesUp = connection.prepareCall("{ ? = call list_early_deaths () }"); 
    toesUp.registerOutParameter(1, Types.OTHER); 
    toesUp.execute(); 
    ResultSet rs = (ResultSet) toesUp.getObject(1); 
    while (rs.next()) { 
    String name = rs.getString(1); 
    int age = rs.getInt(2); 
    mapper.sendDeath(name, age); 

    rs.close(); 
    } catch (SQLException e) { 
    // We should protect these calls. 
    toesUp.close(); 
    con.close(); 

    } connection.prepareCall( )方式掉存储过程的 
      

  2.   

    能不能把存储过程信息写的清楚点。谢谢啦。最近忙的用flex做东西呢。没时间自己好好研究java,所以,想让广大同胞多给几个实用性的例子,要是有存储过程的写法就最好了,谢谢啦
      

  3.   

    百度,Google