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

¹ØÓÚoracleÖÐblob×ֶεļÈëÎÊÌâ

ÔÚoracleÖУ¬ÓÐ4¸ö´ó¶ÔÏó£¨lobs£©ÀàÐÍ¿ÉÓ㬷ֱðÊÇblob,clob,bfile,nclob¡£
¡¡¡¡ÏÂÃæÊǶÔlobÊý¾ÝÀàÐ͵ļòµ¥½éÉÜ¡£
¡¡¡¡ blob:¶þ½øÖÆlob£¬Îª¶þ½øÖÆÊý¾Ý£¬×¿É´ï4GB£¬´æÖüÔÚÊý¾Ý¿âÖС£
¡¡¡¡ clob:×Ö·ûlob,×Ö·ûÊý¾Ý,×¿ÉÒÔ´ïµ½4GB,´æÖüÔÚÊý¾Ý¿âÖС£
¡¡¡¡ bfile:¶þ½øÖÆÎļþ;´æÖüÔÚÊý¾Ý¿âÖ®ÍâµÄÖ»¶ÁÐͶþ½øÖÆÊý¾Ý£¬×î´ó³¤¶ÈÓɲÙ×÷ϵͳÏÞÖÆ¡£
¡¡¡¡ nclob£ºÖ§³Ö¶Ô×Ö½Ú×Ö·û¼¯ºÏ(nultibyte characterset)µÄÒ»¸öclobÁС£
¡¡¡¡ ¶ÔÓÚÔÚÆäËû²»Í¬µÄ¿ª·¢»·¾³£¬ÀýÈçvc,vb,pb,javaµÈ»·¾³Ï¶ÔlobµÄ´¦Àí£¬´¦Àí·½·¨²»¾¡Ïàͬ£¬ÔÚÕâÀォ¾ÙÓÃjdbc´¦ÀílobµÄÀý×Ó
  String strSQL = "Insert Into BKS_XSZPXX(XH,ZPLXM,ZP) Values('3071801040','1',empty_blob())";
  updateTable1(strSQL,conn);
  conn.setAutoCommit(false);
  strSQL = "Select ZP from BKS_XSZPXX where XH='3071801040' For Update";
  
  Statement stmt = null;
  ResultSet rs = null;
  stmt = conn.createStatement();
  rs = stmt.executeQuery(strSQL);
  rs.next();
  BLOB blob = (BLOB) rs.getBlob("ZP");
  OutputStream os = blob.getBinaryOutputStream();// ½¨Á¢Êä³öÁ÷
  BufferedOutputStream output = new BufferedOutputStream(os);
  BufferedInputStream input = new BufferedInputStream(new File("F:/3071801040.jpg").toURL().openStream());
  byte[] buff = new byte[2048000];  //ÓÃ×öÎļþдÈëµÄ»º³å
  int bytesRead;
  while(-1 != (bytesRead = input.read(buff, 0, buff.length)))
  {
     output.write(buff, 0, bytesRead);
     //System.out.println(bytesRead);
  }
  output.close();
  input.close();
  rs.close();
  conn.commit();
  conn.setAutoCommit(true);
  stmt.close();¡¡¡¡


Ïà¹ØÎĵµ£º

Oracle lpad º¯Êý

Oracle lpad º¯Êý£º
°æȨÉùÃ÷£º×ªÔØʱÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂԭʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://soysky.blogbus.com/logs/43623642.html
Oracle lpadº¯Êý½«×ó±ßµÄ×Ö·û´®Ìî³äһЩÌض¨µÄ×Ö·û£¬ÆäÓï·¨¸ñʽÈçÏ£º
lpad( string1, padded_length [, pad_string ] )
ÆäÖУº
string1ÊÇÐèÒªÕ³Ìù×Ö·ûµÄ×Ö·û´®£»
padde ......

oracle scnÑо¿

ÉîÈëÁ˽âOracle SCN (1)
--------------------------------------------------------------------------------
£Û˵Ã÷£Ý±¾À´ÔÚÑо¿Backup and Recovery£¬¿ÉÊÇÔÚ×öʵÑéµÄʱºòÓöµ½Ò»Ð©ÎÊÌâ²»ÊǺÜÀí½â£¬½ø¶ø×·¸ùÇóÔ´£¬Ïë¸ãÇå³þ£¬ÓÚÊDZØÐë¸ãÇå³þSCNºÍRecoveryÖ®¼äµÄ¹Øϵ¡£ÓÚÊǺõת¶øÑо¿SCN£¬ÕâÁ½Ìì¿´Á˺ܶàÎÄÕ£¬°üÀ¨EygleÍ ......

ÈçºÎµ¼ÈëORACLE ±¸·ÝÎļþ

--´´½¨Óû§
create user iagent identified by ia
profile default 
default  tablespace users
temporary tablespace temp
account unlock;
 
--¸ø´´½¨µÄÓû§ÊÚȨ
grant create user,drop user,alter user,create any view,drop any view,exp_full_database,imp_full_database,dba,connect,resour ......

oracleÀïµÄ³£ÓÃÃüÁî

µÚËÄÕ£ºË÷Òý
1.creating function-based indexes
sql> create index summit.item_quantity on summit.item(quantity-quantity_shipped);
 
2.create a B-tree index
sql> create [unique] index index_name on table_name(column,.. asc/desc) tablespace
sql> tablespace_name [pctfree integer] ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ