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

ÔÚOracleÏ¿ª·¢Java³ÌÐòµÄ¾­µäÎÊÌâ½â´ð

 
ÎÊÌâÒ»£ºÈç±£¼ÓÔØJDBCÇý¶¯³ÌÐò£º
 
Õý³£ÎÒÃǼÓÔØÇý¶¯³ÌÐòÓÐÈý¸ö;¾¶£º
 
1.Class.forName(String)ÕâÏëµ±ÓÚclassLoaderÒ»¸öStringÖ¸¶¨µÄÀ࣬ÔÚ×°ÔØʱ°Ñ¸ÃÇý¶¯³ÌÐòµÄ¾²Ì¬ÄÚÈݶ¼³õʼ»¯£¬ÆäʵÕâʱÇý¶¯³ÌÐòÀàµ÷ÓÃÁËDriverManager.registerDriver(driver)·½·¨¡£
 
2.ʹÓÃϵͳÊôÐÔ£ºSystem.getProperty().load(new FileInputStream("ÊôÐÔÎļþ"));
 
ÔÚÊôÐÔÎļþÖÐÖ¸¶¨jdbc.driver=drivername ÕâÑùµÄºÃ´¦ÊÇ¿ÉÒÔͬʱ¼ÓÔضà¸öJDBC£¬»»Êý¾Ý¿âʱ²»Ó÷ÃÎÊJavaÔ´´úÂ룬ֻÊÇÐÞ¸ÄÊôÐÔÎļþ¡£
 
3.Ö±½ÓregisterDriver(driver£©ÕâÖÖ·½·¨×î¿É¿¿£¬¿ÉÒÔÔÚÈκλ·¾³ÏÂʹÓá£
 
1·½·¨¼òµ¥£¬µ«MSµÄJVM²»ÄÜÕýÈ·³õʼ»¯¡£±ÈÈçʹÓÃIEʱÔÚAPPLETÖоͲ»ÄÜʹÓã¬Ó¦¸ÃÓÃ3µÄ·½·¨¡£µ«3£©·½·¨ÔÚÁé»îÐÔ·½Ãæ²»Èç2£¬¿ÉÒÔ¸ù¾Ý»·¾³×ۺϿ¼ÂÇ¡£
 
ÎÊÌâ¶þ£º´ó¶ÔÏó´æ´¢
 
Ò»°ãÀ´Ëµ£¬´ó¶ÔÏó´æ´¢ÊÇ°ÑÎļþ´æµ½Êý¾Ý¿âÖУ¬µ±È»Ò²¿ÉÒÔÄÚ´æÖеij¬´ó×Ö·û´®¡£¶ÔÓÚÏóͼƬÕâÑùµÄÎļþµ±È»ÊÇÓöþ½øÖÆ´æ´¢£¬ÕâÀïÓкܶàÎóÇø£¬ÍøÂçÉϵĽ̳Ì99%¶¼ÊÇÐв»Í¨µÄ£¬
 
Á¬SUN×Ô¼ºµÄÎĵµ¶¼Ò»Ö±´íÎó£¬ËäÈ»´íÎóºÜС¡£°´Ëµ¶þ½øÖÆÎļþÓ¦¸Ã´æΪBLOBÀàÐÍ£¬µ«JBDC2²¢²»ÄÜÖ±½Ó¶ÔBLOB´æÈë¶þ½øÖÆÎļþ£¬Èç¹ûÄãÕâÑù×ö£¬»áµÃµ½Ò»¸öIO¶ø²»ÊÇSQLÒì³££¬Îª´Ë
 
»¨ÁËÎÒ½üÁ½¸öСʱ²ÅŪÇå³þ¡£
 
Èç¹ûÒª°ÑÒ»¸ö¶þÖÆÎļþ´æÈëOracle£¬Óñê×¼µÄJDBCÄã¾ÍÒªÓÃLONG ROWÀàÐÍ£º
 
create table tb_file(name varchar(20),detail long row);
È»ºó:
 
File file = new File("aaa.gif");
int fileLength =(int) file.length();
InputStream fin = new FileInputStream(file);
PreparedStatement pstmt = con.prepareStatement
("insert into tb_file values(´aaa.gif´,?)");
pstmt.setBinaryStream (1, fin, fileLength);
pstmt.executeUpdate();
 
Èç¹ûÄãÒ»¶¨ÒªÓÃBLOB´æ´¢£¬Äã¾Í±ØÐëÓÃOracle×Ô¼ºµÄ·½·¨£º
 
create table tb_file(name varchar(20),detail BLOB);
con.setAutoCommit(false);
stmt.executeUpdate("insert into tb_file values
(´aaa.gif´,empty_blob())");
ÏÂÃæ±ØÐëSELECTµÃµ½BLOBµÄ¶ÔÏóÔÙÏòÀïд£º
 
rs = stmt.executeQuery
("select detail from tb_file
where name=´aaa.gif´
for upfdate" );
if(rs.next())


Ïà¹ØÎĵµ£º

javaÖеÄstringÀàÐÍÈ«Ãæ½âÎö

1. Ê×ÏÈString²»ÊôÓÚ8ÖÖ»ù±¾Êý¾ÝÀàÐÍ£¬StringÊÇÒ»¸ö¶ÔÏó¡£
¡¡¡¡ÒòΪ¶ÔÏóµÄĬÈÏÖµÊÇnull£¬ËùÒÔStringµÄĬÈÏÖµÒ²ÊÇnull£»µ«ËüÓÖÊÇÒ»ÖÖÌØÊâµÄ¶ÔÏó£¬ÓÐÆäËü¶ÔÏóûÓеÄһЩÌØÐÔ¡£
¡¡¡¡2. new String()ºÍnew String(“”)¶¼ÊÇÉêÃ÷Ò»¸öеĿÕ×Ö·û´®£¬ÊÇ¿Õ´®²»ÊÇnull£»
¡¡¡¡3. String str=”kvill”£»
......

java ½âÎö officeϵÁÐÎĵµ

²Î¿¼:
¡¡¡¡http://danadler.com/jacob/
¡¡¡¡http://jakarta.apache.org/poi/
¡¡¡¡http://www.onjava.com/pub/a/onjava/2003/01/22/poi.html
¡¡¡¡http://www.csdn.net/develop/article/15/15311.shtm
¡¡¡¡http://forum.java.sun.com/thread.jsp?forum=40&thread=382666&tstart=0&trange=15
¡¡¡¡Java Excel ......

javaÖÐ×Ö·û´®¶ÔÏóµÄ´´½¨¸öÊý

s = new String("xyz");´´½¨Á˼¸¸öString Object?Á½¸ö¶ÔÏó¡£
String s="ÄãºÃ";int i=3; s=i+s; Õâ¸ö±í´ïʽ¶ÔÂð?ÔÚjavaÖлáÌáʾÊý¾ÝÀàÐͲ»Æ¥Åä¡£ÒòΪstringÊÇÀà!ÕýÈ·×ö·¨: s+="3" »òÕß s+='3'»òÕß s+=(char)i;
ÎÒÃÇÒªÒýÈëÁíÍâÒ»ÖÖ´´½¨String¶ÔÏóµÄ·½Ê½µÄÌÖÂÛ——ÒýºÅÄÚ°üº¬Îı¾¡£ÕâÖÖ·½Ê½ÊÇStringÌØÓеģ¬²¢ÇÒË ......

AESËã·¨javaʵÏÖdzÎö

      java jce¶ÔaesËã·¨ÓкܺõÄÖ§³Ö£¬µ«ÊÇĬÈÏ°²×°µÄJDK»òÕßJREÊDz»ÄÜÖ§³Öaes192bitÃÜÔ¿ºÍaes256bitÃÜÔ¿Á½ÖÖËã·¨µÄ£¬ÐèÒªµ½sun¹Ù·½ÏÂÔØJava(TM) Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files£¬ÒÔÏÂÊÇjce unilimited strength jurisdiction policy files 6µÄ¹Ù·½ ......

ѧϰJavaÖµ´«µÝ·½·¨

ѧϰJavaÖµ´«µÝ·½·¨-Î人±±´óÇàÄñ
¡¡¡¡Öµ´«µÝÊÇÔÚÒ»¸öº¯ÊýÖУ¬µ÷ÓÃÁíÍâÒ»¸öº¯Êý£¬ÆäÖк¬ÓвÎÊý´«µÝµÄÇé¿ö¡£ÍùÍùÖµ´«µÝ¾ÍÊÇ°ÑÊý¾Ý´«µÝµ½ÁíÍâÒ»¸öº¯ÊýÖнøÐнøÒ»²½´¦Àí£¬ÒÔ¸üÇå³þµØÏÔʾº¯ÊýµÄ±í´ïÒâ˼¡£ÔÚº¯Êýµ÷ÓõÄʱºò»áÓÐÊý¾Ý´«µÝ£¬Í¬ÑùÒª¿¼ÂÇÐβκÍʵ²ÎµÄÎÊÌ⣬ÈçÏÂÃæµÄÒ»¸ö³ÌÐò£º
¡¡¡¡on error resume next ShockMode ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ