请贴出调用的代码,还有看看Online Book 里面有很多例子

解决方案 »

  1.   

    import java.math.BigDecimal;
    import java.sql.*;public class JSBDDBBean
    {
        public String getSQLString()
        {
            return SQLString;
        }    public String getURL()
        {
            return URL;
        }    public void setURL(String s)
        {
            URL = s;
        }    public void setPassword(String s)
        {
            password = s;
        }    public String getDriver()
        {
            return driver;
        }    public void setDriver(String s)
        {
            driver = s;
        }    public String getUserID()
        {
            return userID;
        }    public void setUserID(String s)
        {
            userID = s;
        }    public void execute()
            throws Exception, SQLException
        {
            try
            {
                Class.forName("COM.ibm.db2.jdbc.app.DB2Driver").newInstance();
            }
            catch(Exception exception)
            {
                throw exception;
            }
            try
            {
                conn = DriverManager.getConnection(URL, userID, password);
                sqlStatement = conn.prepareCall(getSQLString());
                sqlStatement.execute();
                sqlStatement.close();
                conn.close();
                return;
            }
            catch(SQLException sqlexception)
            {
                throw sqlexception;
            }
        }    public JSBDDBBean()
        {
            SQLString = "CALL DB2ADMIN.PRO_PROC1()";
        }    protected String SQLString;
        protected String URL;
        protected String password;
        protected String driver;
        protected String userID;
        protected CallableStatement sqlStatement;
        protected Connection conn;
    }
      

  2.   

    应该不是调用的代码的问题,因为用此代码调用原来的存储过程仍然可用,但新建的存储过程都只能在db2下面调用,而用java调用就会报SQL1109N The specified DLL "DB2ADMIN.PRO_PROC1" could not be loaded
    的错