EAS的数据库中有一个自定义函数newbosid,他的传入参数是对应实体的BOSTYPE,输出值是PK.
一般做接口或其他会调用到这个.方式大致如下:
public static void main(String[] paramArrayOfString) { // 加载驱动程序 try { Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); // 得到数据库连接 Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@10.195.36.13:1521:kingdee","eas_tst","eas_tst"); CallableStatement cs = conn.prepareCall("{ ?=call newbosid(?)}"); // Register the type of the return value cs.registerOutParameter(1, Types.VARCHAR ); // Set the value for the IN parameter cs.setString(2,"E91B6727"); // Execute and retrieve the returned value for (int i = 0; i < 20; i++) { cs.execute(); String str = cs.getString(1); System.out.println(str); } } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } }