Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA´æ´¢¹ý³ÌºÍµ÷ÓÃ

´úÂëÄÚÈÝ
create or replace procedure batchUpdateCustomer(p_age in number) as
begin
update CUSTOMERS set AGE=AGE+1 where AGE>p_age;
end;
ÒÔÉÏ´æ´¢¹ý³ÌÓÐÒ»¸ö²ÎÊýp_age£¬´ú±í¿Í»§µÄÄêÁ䣬ӦÓóÌÐò¿É°´ÕÕÒÔÏ·½Ê½µ÷Óô洢¹ý³Ì£º
´úÂëÄÚÈÝ
tx = session.beginTransaction();
Connection con=session.connection();
String procedure = "{call batchUpdateCustomer(?) }";
CallableStatement cstmt = con.prepareCall(procedure);
cstmt.setInt(1,0); //°ÑÄêÁä²ÎÊýÉèΪ0
cstmt.executeUpdate();
tx.commit();
create or replace produre batchUpdateStudent(a in number) as
begin
update STUDENT set AGE=AGE+1 where AGE>a;
end;
µ÷ÓôúÂëÈçÏ£º
Transaction tx=session.beginSession();
Connection conn=session.connection();
String pd=”...{call batchUpdateStudent(?)}”;
CallableStatement cstmt=conn.PrepareCall(pd);
cstmt.setInt(1,20); //°ÑÄêÁäÕâ¸ö²ÎÊýÉèΪ20
tx.commit()£»


Ïà¹ØÎĵµ£º

JavaÀàµÄһЩÈÏʶ

ϱßÊÇ×Ô¼º¶ÔÀàµÄһЩʹÓÃÈÏʶ£¬Èç¹ûÓв»¶ÔµÄ£¬¾´Çë´ïÈËÖ¸Õý¡£
ÈκÎÀàµÄʹÓö¼¾­Àú£ºÀà¼ÓÔØºÍÀà³õʼ»¯µÄ½×¶Î¡£
Àà³õʼ»¯:
*ÆÕͨ³ÉÔ±ÊôÐÔ£º
 1.ϵͳĬÈϳõʼ»¯£¬»ù±¾ÀàÐÍĬÈÏΪ0»òfalse£¬ÒýÓÃÀàÐÍĬÈÏΪnull¡£
 2.ÉùÃ÷ʱÏÔʾ³õʼ»¯»òÆÕͨ³õʼ»¯¿é(×¢Ò⣺ÆÕͨ³õʼ»¯Ö»ÓÐÔÚnew¹¹Ô캯Êý´´½¨ÊµÀýʱ£¬²Å»á±»×Ô¶¯µ÷ ......

JAVA»Øµ÷»úÖÆ£¨×ª£©

java»Øµ÷»úÖÆ£º
Èí¼þÄ£¿éÖ®¼ä×ÜÊÇ´æÔÚ×ÅÒ»¶¨µÄ½Ó¿Ú£¬´Óµ÷Ó÷½Ê½ÉÏ£¬¿ÉÒÔ°ÑËûÃÇ·ÖΪÈýÀࣺͬ²½µ÷Óᢻص÷ºÍÒì²½µ÷Óá£
ͬ²½µ÷ÓÃÊÇÒ»ÖÖ×èÈûʽµ÷Ó㬵÷Óà ·½ÒªµÈ´ý¶Ô·½Ö´ÐÐÍê±Ï²Å·µ»Ø£¬ËüÊÇÒ»ÖÖµ¥Ïòµ÷Óã»
»Øµ÷ÊÇÒ»ÖÖË«Ïòµ÷ÓÃģʽ£¬Ò²¾ÍÊÇ˵£¬±»µ÷Ó÷½ÔÚ½Ó¿Ú±»µ÷ÓÃʱҲ»áµ÷ÓöԷ½µÄ½Ó¿Ú£»
Òì²½µ÷ÓÃÊÇÒ»ÖÖÀàËÆÏûÏ¢»òʼþµÄ» ......

һƪ²»´íµÄ½²½âJavaÒì³£µÄÎÄÕÂ


±¾ÎÄÓɲ©Ö÷´Óhttp://www.blogjava.net/freeman1984/archive/2007/09/27/148850.html×ªÔØ£»Ô­Îijö´¦£¬²©Ö÷Ò²²»ÖªµÀ£¬Ï£Íû¶Ô´ó¼ÒÓеã°ïÖú......
ÁùÖÖÒì³£´¦ÀíµÄªϰ
Äã¾õµÃ×Ô¼ºÊÇÒ»¸öJavaר¼ÒÂð£¿ÊÇ·ñ¿Ï¶¨×Ô¼ºÒѾ­È«ÃæÕÆÎÕÁËJavaµÄÒì³£´¦Àí»úÖÆ£¿ÔÚÏÂÃæÕâ¶Î´úÂëÖУ¬ÄãÄܹ»Ñ¸ËÙÕÒ³öÒì³£´¦ÀíµÄÁù¸öÎÊÌâÂ𣿠
1 Output ......

Java Á¬½Ó SQL Server 2000ʾÀý´úÂë

ÄãµÄSQL Server 2000±ØÐë´òÉÏSP3µÄ²¹,È»ºó°²×°MicrosoftµÄJDBCÇý¶¯,½«ÒÔÏÂÈý¸öjar°ü¸´ÖƵ½WebContent\WEB-INF\lib
msbase.jar
mssqlserver.jar
msutil.jar
ÏÂÃæÊDzâÊÔ´úÂ룬ûÓб¨´íÊý¾Ý¿â¾ÍÄÜÕý³£Á¬½Ó
 public class DbcTest {
/**
* @param args
*/
public static void main(String[] args) {
Str ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ