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 ³éÏóÀàºÍ½Ó¿ÚµÄ±È½Ï
³éÏóÀàºÍ½Ó¿Ú¶¼ÊǽøÐÐÃæÏò¶ÔÏóÉè¼ÆÊ±×¨ÓõÄÉè¼Æ½á¹¹£¬ÔÚʵ¼Ê½øÐÐÏîÄ¿Éè¼ÆÊ±£¬¾³£ÐèÒª¿¼ÂǵÄÎÊÌâ¾ÍÊÇ——“ʹÓóéÏóÀ໹Êǽӿڔ£¿ÏÂÃæÍ¨¹ý¶ÔÓÚ³éÏóÀàºÍ½Ó¿Ú½øÐмòµ¥µÄ±È½Ï£¬ÊìϤÁ½ÕßÖ®¼äµÄÇø±ðºÍÁªÏµ£¬´Ó¶øÔÚʵ¼ÊÉè¼ÆÊ±Ê ......
java¿ª·¢µÚÒ»²¿£¬»·¾³±äÁ¿ÅäÖÃ
windows xpÏÂÅäÖÃJDK»·¾³±äÁ¿£º
1.°²×°JDK£¬°²×°¹ý³ÌÖпÉÒÔ×Ô¶¨Ò尲װĿ¼µÈÐÅÏ¢£¬ÀýÈçÎÒÃÇÑ¡Ôñ°²×°Ä¿Â¼ÎªD:\java\jdk1.5.0_08£»
¡¡ 2.°²×°Íê³Éºó£¬ÓÒ»÷“ÎҵĵçÄÔ”£¬µã»÷“ÊôÐÔ”£»
3.Ñ¡Ôñ“ ......
The Java virtual machine defines various runtime data areas that are used during execution of a program. Some of these data areas are created on Java virtual machine start-up and are destroyed only when the Java virtual machine exits. Other data areas are per thread. Per-thread data areas are create ......
1990£1994£ºJavaÔµÆð
Larry Wall˵£¬ÓÅÐã³ÌÐòÔ±Ó¦ÓеÄÈý¸öÌØµã:ÀÁ¶è¡¢¼±ÔêºÍ°ÁÂý¡£Java¾ÍÊǵ®ÉúÔÚһȺÀÁ¶è¡¢¼±Ôê¶ø°ÁÂýµÄ³ÌÐòÌì²ÅÖ®ÖС£
1990Äê12Ô£¬SunµÄ¹¤³ÌʦPatrick Naughton±»µ±Ê±Ôã¸âµÄSun C++¹¤¾ßÕÛÄ¥µÄ¿ì·èÁË¡£Ëû´óÉù±§Ô¹£¬²¢ÍþвҪÀ뿪SunתͶµ±Ê±ÔÚSteve JobsÁ쵼֮ϵÄNeXT¹«Ë¾¡£Áìµ¼²ãΪÁËÁôסËû£¬¸øËû ......