javaµ÷Óô洢¹ý³ÌÎÞ·¨È¡µÃ·µ»Ø²ÎÊý
»·¾³£ºÊý¾Ý¿âsql server2005£¬jdk1.6 £¬myeclipse£¬Çý¶¯jdts1.2.2
Ö´ÐÐÒÔÏ´úÂ룬±¨´í£º
String querySQL = "{?=call p_sys_manager_csReport(?,?,?,?,?)}";
cstmt = conn.prepareCall(querySQL);
cstmt.registerOutParameter(1, java.sql.Types.INTEGER);
cstmt.setInt(2, modType);
cstmt.setInt(3, dptId);
cstmt.setInt(4, eplId);
cstmt.registerOutParameter(5, java.sql.Types.VARCHAR);
cstmt.registerOutParameter(6, java.sql.Types.VARCHAR);
rs = cstmt.executeQuery();
if (rs != null) {
if (rs.next()) {
companyTotal = rs.getInt("companyTotal");
}
}
String temp = null;
temp = cstmt.getString(5);//´ËÐб¨´í
±¨´íÐÅϢΪ£º
java.sql.SQLException: Output parameters have not yet been processed. Call getMoreResults().
at net.sourceforge.jtds.jdbc.ParamInfo.getOutValue(ParamInfo.java:159)
at net.sourceforge.jtds.jdbc.JtdsCallableStatement.getOutputValue(JtdsCallableStatement.java:116)
at net.sourceforge.jtds.jdbc.JtdsCallableStatement.getString(JtdsCallableStatement.java:310)
±¨´íÐÅϢ˵µÃºÜÃ÷°×£¬¾ÍÊÇÊä³ö½á¹û²ÎÊýδ´¦Àí£¬±ØÐëµ÷ÓÃgetMoreResults()·½·¨ÒÔÅжÏÊÇ·ñ»¹Óнá¹û¼¯¡£
È»ºóÐ޸ĴúÂ룬ÎÊÌâ½â¾ö£º
String querySQL = "{?=call p_sys_manager_csReport(?,?,?,?,?)}";
cstmt = conn.prepareCall(querySQL);
cstmt.registerOutParameter(1, java.sql.Types.INTEGER);
cstmt.setInt(2, modType);
cstmt.setInt(3, dptId);
cstmt.setInt(4, eplId);
cstmt.registerOutParameter(5, java.sql.Types.VARCHAR);
cstmt.registerOutParameter(6, java.sql.Types.VARCHAR);
rs = cstmt.executeQuery();
if (rs != null) {
if(rs.next()) {
companyTotal = rs.getInt("companyTotal");
}
}
String temp = null;
/*
*¼Ç¼¼¯»ñÈ¡µ½ºó,°Ñrs¼Ç¼¼¯Ñ»·È¡³öºó»òÕßµ÷ÓÃcstmt.getMoreResults()·½·¨ºó,sqlserver²Å»á´¦Àíoutput·µ»ØÖµ
*/
if (!cstmt.getMoreResults()) {//´ËÐÐÅжÏÊÇ·ñ»¹Óиü¶àµÄ½á¹û¼¯,Èç¹ûûÓÐ,½ÓÏÂÀ´»á´¦Àíoutput·µ»Ø²ÎÊýÁË
temp = cstmt.getString(5);//´ËÐв»ÔÙ±¨´í
}
ÆäÖиÄΪÒÔÏ´úÂëÒ²²»±¨´í£º
if (rs != null) {
Ïà¹ØÎĵµ£º
8.9 ³éÏóÀàºÍ½Ó¿Ú
ÔÚʵ¼ÊµÄÏîÄ¿ÖУ¬Õû¸öÏîÄ¿µÄ´úÂëÒ»°ã¿ÉÒÔ·ÖΪ½á¹¹´úÂëºÍÂß¼µÄ´úÂë¡£¾ÍÏñ½¨Ôì·¿ÎÝʱ£¬ÐèÒªÊ×ÏȴÕû¸ö·¿ÎݵĽṹ£¬È»ºóÔÙϸ»¯·¿ÎÝÏà¹ØµÄÆäËüµÄ½á¹¹£¬Ò²ÏñÖÆÔìÆû³µÊ±£¬ÐèÒªÊ×ÏÈÖÆ×÷Æû³µµÄ¿ò¼Ü£¬È»ºó²ÅÊÇ°²×°Åä¼þÒÔ¼°ÃÀ»¯µÈ¹¤×÷¡£³ÌÐòÏîÄ¿µÄʵÏÖÒ ......
Ñ¡ÔñÌâ
3ÔĶÁһϳÌÐò£º
Boolean a=false;
Boolean b=true;
Boolean c=(a&b)&&(!b);
Int result=b==false?1:2;
Õâ¶Î³ÌÐòÖ´ÐÐÍêºó£¬cÓëresultµÄÖµÊÇ£¨D£©¡£
A c=false; result=1; B. c=true;result=2;
C£®c=true;result=1 D. c=false; result=2
6.ÏÂÊöÉùÃ÷ÖÐÄÄÖÖ¿É·À ......
1990£1994£ºJavaÔµÆð
Larry Wall˵£¬ÓÅÐã³ÌÐòÔ±Ó¦ÓеÄÈý¸öÌصã:ÀÁ¶è¡¢¼±ÔêºÍ°ÁÂý¡£Java¾ÍÊǵ®ÉúÔÚһȺÀÁ¶è¡¢¼±Ôê¶ø°ÁÂýµÄ³ÌÐòÌì²ÅÖ®ÖС£
1990Äê12Ô£¬SunµÄ¹¤³ÌʦPatrick Naughton±»µ±Ê±Ôã¸âµÄSun C++¹¤¾ßÕÛÄ¥µÄ¿ì·èÁË¡£Ëû´óÉù±§Ô¹£¬²¢ÍþвҪÀ뿪SunתͶµ±Ê±ÔÚSteve JobsÁ쵼֮ϵÄNeXT¹«Ë¾¡£Áìµ¼²ãΪÁËÁôסËû£¬¸øËû ......
Õû¸öÀàÎļþ×¢ÊÍ
ʾÀýÈçÏÂ
:
/*
* @(#)Object.java
1.61 03/01/23
*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package java.lang;
& ......