当前位置: 技术问答>java相关
请问Java可否调用MsSQL的存储过程,如何调用?
来源: 互联网 发布时间:2015-02-01
本文导语: | 給一個我調的給你看看: Connection conn = null; Statement stmt = null; String[][] strReturn = null; conn = DataConnection.getConnection("lh.order.server.dba.report.ordershipmentweekly.DBA_OrderShipmentWeekly.dealWithData()", ...
|
給一個我調的給你看看:
Connection conn = null;
Statement stmt = null;
String[][] strReturn = null;
conn = DataConnection.getConnection("lh.order.server.dba.report.ordershipmentweekly.DBA_OrderShipmentWeekly.dealWithData()",
dbInfo);
stmt = conn.createStatement();
String strDateCon = GClass.getFieldCompareStr(args[2], args[3],"TRANS_DATE", 1);
String strCustomerNoCon = GClass.getFieldCompareStr(args[0], args[1],"TYPE_NO", 1);
String strSaleBillCon = GClass.getFieldCompareStr(args[4], args[5],"TYPE_NO", 1);
String strSql = " exec ordershipmentweekly "
+ GClass.getSqlString(strCompId)+","
+ GClass.getSqlString(strDateCon) + ","
+ GClass.getSqlString(strCustomerNoCon) + ","
+ GClass.getSqlString(strSaleBillCon) + ","
+ GClass.getSqlString(args[6]) + ","
+ GClass.getSqlString(args[7]);
stmt.execute(strSql);
ResultSet reset = stmt.getResultSet();
if(reset==null||!reset.last())
return strReturn;
int nRows = reset.getRow();
int nMasterColumns = COL_AMOUNT;
strReturn = new String[nRows][nMasterColumns];
reset.beforeFirst();
int nIndex = 0;
while(reset.next())
{
for(int i = 0;i
Connection conn = null;
Statement stmt = null;
String[][] strReturn = null;
conn = DataConnection.getConnection("lh.order.server.dba.report.ordershipmentweekly.DBA_OrderShipmentWeekly.dealWithData()",
dbInfo);
stmt = conn.createStatement();
String strDateCon = GClass.getFieldCompareStr(args[2], args[3],"TRANS_DATE", 1);
String strCustomerNoCon = GClass.getFieldCompareStr(args[0], args[1],"TYPE_NO", 1);
String strSaleBillCon = GClass.getFieldCompareStr(args[4], args[5],"TYPE_NO", 1);
String strSql = " exec ordershipmentweekly "
+ GClass.getSqlString(strCompId)+","
+ GClass.getSqlString(strDateCon) + ","
+ GClass.getSqlString(strCustomerNoCon) + ","
+ GClass.getSqlString(strSaleBillCon) + ","
+ GClass.getSqlString(args[6]) + ","
+ GClass.getSqlString(args[7]);
stmt.execute(strSql);
ResultSet reset = stmt.getResultSet();
if(reset==null||!reset.last())
return strReturn;
int nRows = reset.getRow();
int nMasterColumns = COL_AMOUNT;
strReturn = new String[nRows][nMasterColumns];
reset.beforeFirst();
int nIndex = 0;
while(reset.next())
{
for(int i = 0;i