ʹÓÃJNI¼¼ÊõʵÏÖJAVA³ÌÐòµ÷ÓÃdll
JAVAµÄ¿çƽ̨µÄÌØÐÔÉîÊÜjava³ÌÐòÔ±ÃǵÄϲ°®,µ«ÕýÊÇÓÉÓÚËüΪÁËʵÏÖ¿çƽ̨µÄÄ¿µÄ,ʹµÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ,´ó´óÔ¼ÊøÁËËüµÄ¹¦ÄÜ,±ÈÈçÓëһЩӲ¼þÉ豸ͨÐÅ,ÍùÍùÒª»¨·ÑºÜ´óµÄ¾«Á¦È¥Éè¼ÆÁ÷³Ì±àд´úÂëÈ¥¹ÜÀíÉ豸¶Ë¿Ú,¶øÇÒÓÐһЩÉ豸³§ÉÌÌṩµÄÓ²¼þ½Ó¿ÚÒѾ¾¹ýÒ»¶¨µÄ·â×°ºÍ´¦Àí,²»ÄÜÖ±½ÓʹÓÃjava³ÌÐòͨ¹ý¶Ë¿ÚºÍÉ豸ͨÐÅ,ÕâÖÖÇé¿öϾ͵ÿ¼ÂÇʹÓÃjava³ÌÐòÈ¥µ÷ÓñȽÏÉó¤Í¬ÏµÍ³´ò½»µÀµÄµÚÈý·½³ÌÐò,´Ó1.1°æ±¾¿ªÊ¼µÄJDKÌṩÁ˽â¾öÕâ¸öÎÊÌâµÄ¼¼Êõ±ê×¼:JNI¼¼Êõ.
JNIÊÇJava Native Interface(Java±¾µØ½Ó¿Ú)µÄËõд,±¾µØÊÇÏà¶ÔÓÚjava³ÌÐòÀ´ËµµÄ,Ö¸Ö±½ÓÔËÐÐÔÚ²Ù×÷ϵͳ֮ÉÏ,Óë²Ù×÷ϵͳֱ½Ó½»»¥µÄ³ÌÐò.´Ó1.1°æ±¾µÄJDK¿ªÊ¼,JNI¾Í×÷Ϊ±ê׼ƽ̨µÄÒ»²¿·Ö·¢ÐÐ.ÔÚJNI³öÏֵijõÆÚÊÇΪÁËJava³ÌÐòÓë±¾µØÒѱàÒëÓïÑÔ,ÓÈÆäÊÇCºÍC++µÄ»¥²Ù×÷¶øÉè¼ÆµÄ,ºóÀ´¾¹ýÀ©Õ¹Ò²¿ÉÒÔÓëcºÍc++Ö®ÍâµÄÓïÑÔ±àдµÄ³ÌÐò½»»¥,ÀýÈçDelphi³ÌÐò.
ʹÓÃJNI¼¼Êõ¹ÌÈ»ÔöÇ¿ÁËjava³ÌÐòµÄÐÔÄܺ͹¦ÄÜ,µ«ÊÇËüÒ²ÆÆ»µÁËjavaµÄ¿çƽ̨µÄÓŵã,Ó°Ïì³ÌÐòµÄ¿ÉÒÆÖ²ÐԺͰ²È«ÐÔ,ÀýÈçÓÉÓÚÆäËûÓïÑÔ(ÈçC/C++)¿ÉÄÜÄܹ»ËæÒâµØ·ÖÅä¶ÔÏó/Õ¼ÓÃÄÚ´æ,JavaµÄÖ¸Õ밲ȫÐԵò»µ½±£Ö¤.µ«ÔÚÓÐЩÇé¿öÏÂ,ʹÓÃJNIÊÇ¿ÉÒÔ½ÓÊܵÄ,ÉõÖÁÊDZØÐëµÄ,ÀýÈçÉÏÃæÌáµ½µÄʹÓÃjava³ÌÐòµ÷ÓÃÓ²¼þ³§ÉÌÌṩµÄÀà¿âͬÉ豸ͨÐŵÈ,Ä¿Ç°Êг¡ÉϵÄÐí¶à¶Á¿¨Æ÷É豸¾ÍÊÇÕâÖÖÇé¿ö.ÔÚÕâ±ØÐëʹÓÃJNIµÄÇé¿öÏÂ,¾¡Á¿°ÑËùÓб¾µØ·½·¨¶¼·â×°ÔÚµ¥¸öÀàÖÐ,Õâ¸öÀàµ÷Óõ¥¸öµÄ±¾µØ¿âÎļþ,²¢±£Ö¤¶ÔÓÚÿÖÖÄ¿±ê²Ù×÷ϵͳ,¶¼¿ÉÒÔÓÃÌض¨ÓÚÊʵ±Æ½Ì¨µÄ°æ±¾Ìæ»»Õâ¸öÎļþ,ÕâÑùʹÓÃJNIµÃµ½µÄÒª±ÈʧȥµÄ¶àºÜ¶à.
ÏÖÔÚ¿ªÊ¼ÌÖÂÛÉÏÃæÌáµ½µÄÎÊÌâ,Ò»°ãÉ豸ÉÌ»áÌṩÁ½ÖÖÀàÐ͵ÄÀà¿âÎļþ,windowsϵͳµÄ»á°üº¬.dll/.h/.libÎļþ,¶ølinuxϵͳµÄ»á°üº¬.so/.aÎļþ,ÕâÀïÖ»ÌÖÂÛwindowsϵͳϵÄc/c++±àÒëµÄdllÎļþµ÷Ó÷½·¨.
ÎÒ°ÑÉ豸ÉÌÌṩµÄdllÎļþ³Æ֮ΪµÚÈý·½dllÎļþ,Ö®ËùÒÔ˵µÚÈý·½,ÊÇÒòΪJNIÖ±½Óµ÷ÓõÄÊÇ°´ËüµÄ±ê׼ʹÓÃc/c++ÓïÑÔ±àÒëµÄdllÎļþ,Õâ¸öÎļþÊÇ¿Í»§³ÌÐòÔ±°´ÕÕÉ豸ÉÌÌṩµÄ.hÎļþÖеÄÁгöµÄ·½·¨±àдµÄdllÎļþ,ÎÒ³Æ֮ΪµÚ¶þ·½dllÎļþ,ÕæÕýµ÷ÓÃÉ豸ÉÌÌṩµÄdllÎļþµÄÆäʵ¾ÍÊÇÕâ¸öµÚ¶þ·½dllÎļþ.µ½ÕâÀï,½â¾öÎÊÌâµÄ˼·ÒѾ²úÉúÁË,´ó¿®·Ö¿ÉÒÔ·ÖΪÈý²½:
1>±àдһ¸öjavaÀà,Õâ¸öÀà°üº¬µÄ·½·¨ÊÇ°´ÕÕÉ豸É
Ïà¹ØÎĵµ£º
Ê×Ïȵ½¸Ãhttp://ostermiller.org/utils/download.html µØÖ·ÏÂÔØcom.Ostermiller.util cvsµÄjar°ü¡£
public class CsvFileParser{
private LabeledCSVParser csvParser;//csv½âÎöÆ÷£¬¶ÔÓÚµÚÒ»ÐеıíÍ·ÐÅÏ¢£¬×Ô¶¯¼ÓÔØΪË÷Òý¹Ø¼ü×Ö
private int currLineNum = -1;//ÎļþËù¶Áµ½ÐÐÊý
private String[] currLi ......
ʹÓÃJava³ÌÐò´ÓÊý¾Ý¿âÖвéѯ´óÁ¿µÄÊý¾ÝʱÈÝÒ׳öÏÖÒì³£:
java.lang.OutOfMemoryError: Java heap space
ÔÚJVMÖÐÈç¹û98£¥µÄʱ¼äÊÇÓÃÓÚGCÇÒ¿ÉÓÃµÄ Heap size ²»×ã2£¥µÄʱºò½«Å׳ö´ËÒì³£ÐÅÏ¢¡£
»¹ÓÐʹÓÃjxl¶ÁдexcelÎļþʱ£¬Í¬Ê±¶ÁÈëËùÓмǼ£¬Ò²ÈÝÒ׳öÏÖÕâ¸öÎÊÌâ¡£
JVM¶ÑµÄÉèÖÃÊÇÖ¸java³ÌÐòÔËÐйý³ÌÖÐJVM¿ÉÒÔµ÷ÅäʹÓõÄÄÚ ......
ÉùÃ÷£º
ÒÔϵÄÀý×Ó²»Ò»¶¨ÕýÈ·£¬Ö»ÊÇΪÁËÑÝʾ´ó¸ÅµÄÁ÷³Ì¡£
Ò»£ºÎÞ·µ»ØÖµµÄ´æ´¢¹ý³Ì
´æ´¢¹ý³ÌΪ£º
CREATE OR REPLACE PROCEDURE TESTA(PARA1 IN VARCHAR2,PARA2 IN VARCHAR2) AS
BEGIN
INSERT INTO HYQ.B_ID (I_ID,I_NAME) VALUES (PARA1, PARA2);
END TESTA;
È»ºóÄØ£¬ÔÚjavaÀïµ÷ÓÃʱ¾ÍÓÃÏÂÃæµÄ´ ......
1.[http://www.javaalmanac.com] – Java¿ª·¢ÕßÄê¼øÒ»ÊéµÄÔÚÏß°æ±¾. ÒªÏë¿ìËٲ鵽ijÖÖJava¼¼ÇɵÄÓ÷¨¼°Ê¾Àý´úÂë, ÕâÊÇÒ»¸ö²»´íµÄÈ¥´¦.
2.[http://www.onjava.com] – O’ReillyµÄJavaÍøÕ¾. ÿÖܶ¼ÓÐÐÂÎÄÕÂ.
3.[http://java.sun.com] – ¹Ù·½µÄJava¿ª·¢ÕßÍøÕ¾ – ÿÖܶ¼ÓÐÐÂÎÄÕ·¢±í.
4.[http ......
ClassLoaderÒ»¸ö¾³£³öÏÖÓÖÈúܶàÈËÍû¶øÈ´²½µÄ´Ê£¬±¾ÎĽ«ÊÔͼÒÔ×îdzÏÔÒ׶®µÄ·½Ê½À´½²½â ClassLoader£¬Ï£ÍûÄܶԲ»Á˽â¸Ã»úÖƵÄÅóÓÑÆðµ½Ò»µãµã×÷Óá£
ÒªÉîÈëÁ˽âClassLoader£¬Ê×ÏȾÍÒªÖªµÀClassLoaderÊÇÓÃÀ´¸ÉʲôµÄ£¬¹ËÃû˼Ò壬Ëü¾ÍÊÇÓÃÀ´¼ÓÔØClassÎļþµ½JVM£¬ÒÔ¹©³ÌÐòʹÓõġ£ÎÒÃÇÖªµÀ£¬java³ÌÐò¿ÉÒÔ¶¯Ì¬¼ÓÔØÀඨÒ壬¶øÕâ ......