| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> oracle >> Oracle shu ju ku he JSP lian jie yao zhu yi de yi xie wen ti
 

Oracle shu ju ku he JSP lian jie yao zhu yi de yi xie wen ti

2008-06-26 07:29:35 编辑來源:互联网 评论
 
本文为【Oracle数据库和JSP连接要注意的一些问题】的拼音翻译版
  yong ORACLE9i、oracle8、 you hen chang de yi duan shi jian , wo ba yong yu JSP zhong xu yao zhu yi de wen ti zai zhe li xie chu lai , jin gong da jia shen kao le 。
  yi 、 ru he qu chu li Clob、BLOB de da lei xing
  CLOB ke yong yu cun fang da wen ben shu ju , zui duo ke cun chu 4GB shu ju , zai ying yong kai fa zhong bi jiao chang jian .java ti gong de sql.Clob lei yu zhi dui ying . ta ti gong liang ge fang fa lai du qu Clob de shu ju :
  getCharacterStream() fang fa fan hui an unicode bian ma de shu ru liu (java.io.Reader dui xiang )
  getAsciiStream() fang fa fan hui an ASCII bian ma de shu ru liu (java.io.InputStream dui xiang )
  suo yi ru guo ni de shu ju ku zhong you ke neng cun chu zhong wen zi fu de hua , jiu yao shi yong qian yi ge fang fa .
  xian zai ju yi ge shi ji de li zi , rang wo yi bu bu xue xi ru he shi yong CLOB.
  shou xian , chuang jian yi ge han CLOB zi duan de biao :
  create table test (id INTEGER, content clob);
  jie xia lai , wo men tong guo JSP wang zhe zhang biao li cha ru yi tiao ji lu , ran hou zai huo qu xian shi ta .
  cha ru cao zuo :
  yi shang xu yao zhu yi de ji dian shi :
  1)clob lei xing de shu ju bu neng zhi jie insert, yao xian tong guo empty_clob() fang fa gei ta fen pei yi ge locator( tong li ,blob de yong empty_blob() han shu fen pei locator). ran hou ba ta select chu lai ( ci shi ta dang ran mei you shu ju , dan jie guo ji bu shi kong de ), de dao yi ge Clob de dui xiang , xiu gai gai dui xiang de nei rong rang ta man zu wo men de xu yao , zai tong guo update fang fa geng xin gai xing ji lu .
  2) tong guo select xiu gai han lob lei xing de ji lu shi yi ding yao suo ding gai xing ( tong guo for update guan jian zi shi xian ), fou ze oracle hui bao cuo .
  3) gang cha ru de ji lu jiu select for update, hui chu xian " wei fan du qu shun xu " cuo wu , jie jue ban fa shi jiang zi dong ti jiao gong neng zhi wei false, ji bu yuan xu zi dong ti jiao , ran hou commit ta , zai select, jiu ke yi le . zhe jiu shi shang mian na duan dai ma li //* liang xing de zuo yong .
  xia mian , wo men jiang gang cha ru de ji lu cong shu ju ku zhong du qu chu lai bing xian shi zhi :
  er 、 bian ma wen ti
  yin wei JAVA de kai fa zhe shi lao wai , suo yi ta men dui zhong wen de zhi chi bing bu shi tai hao , zhe yi dian rang bu shao de wo men gan dao hen shi tou tong , ye jiu shi wo men tong guo shuo de han zi bian ma wen ti ba , guan yu yi xie han zi bian ma de gui fan wo jiu bu duo shuo le , wo zhu yao shi tan tan zai he oracle shu ju ku lian jie shi de yi xie xiao wen ti , bu guo zhe xie xiao wen ti hen shi rang ren tou tong de 。
  1、 zai cha ru dao shu ju ku zhong de zhong wen wen ti yao zhuan huan cheng bian ma
  2、 cong shu ju ku zhong du dao zhong wen you yao zhuan huan cheng bian ma
  rang wo men kan yi ge bian ma de JAVA dai ma :
  
  //ECov.java
  import java.io.UnsupportedEncodingException;
  public class ECov
  {
  public static String asc2gb(String asc){
  String ret;
  if(asc==null)return asc;
  try{
  ret=new String(asc.getBytes("ISO8859_1"),"GB2312");
  }
  catch(UnsupportedEncodingException e){
  ret=asc;
  }
  return ret;
  }
  public static String gb2asc(String gb){
  String ret;
  if(gb==null)return gb;
  try{
  ret=new String(gb.getBytes("GB2312"),"ISO8859_1");
  }
  catch(UnsupportedEncodingException e){
  ret=gb;
  }
  return ret;
  }
  public static int byte2int(byte b){
  return ((-1)>>>24)&b;
  }
  }
  qi shi zhe duan dai ma de yi si ye jiu shi ba liang zhong fang fa he er wei yi le 。
  zai jin xing shu ju ku cha ru shi yao yong ECov.gb2asc(arg), yao zai du shi yao yong ECov.asc2gb(arg)。 qi zhong zui guan jian de yi dian jiu shi Oracle hao xiang zhi ren shi ISO8859_1 zhe zhong ge shi de bian ma ba ( jin shi wo de xiang fa )。
  san 、 yi xie xiao xi jie
  1、 jiu shi setAutoCommit(true or false), jiu shi wo men zai sqlPlus zhong chang yong commit() de gong neng , ru guo shi yong true, jiu bu yao yong commit(), fou ze huan shi yong commit() fang fa de 。
  2、 dui ri qi lei xing de chu li , qi shi ta bing bu shi xiang xiang zhong setDate(),getDate() na me jian dan de , zhong jian you hen da de lou dong 。 da jia zi ji duo tiao shi jiu hui jiao de you hen duo de le qu de 。
  3、 zai he shu ju ku zhong zui hao shi cai yong lian jie chi ji shu , yong biao zhun de J2EE de huan jing , yong jian dan de JNDI ji shu , shi hen hao de yi zhong fang fa de 。【原文】【汉音对照
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
yong ORACLE9i、oracle8、 you hen chang de yi duan shi jian , wo ba yong yu JSP zhong xu yao zhu yi de wen ti zai zhe li xie chu lai , jin gong da jia shen kao le 。 yi 、 ru he qu chu li Clob、BLOB de da lei xing CLOB ke yong yu cun fang da wen ben shu ju , zui duo ke cun chu 4GB shu ju , zai ying yong kai fa zhong bi jiao chang jian .java ti gong de sql.Clob lei yu zhi dui ying . ta ti gong liang ge fang fa lai du qu Clob de shu ju : getCharacterStream() fang fa fan hui an unicode bian ma de shu ru liu (java.io.Reader dui xiang ) getAsciiStream() fang fa fan hui an ASCII bian ma de shu ru liu (java.io.InputStream dui xiang ) suo yi ru guo ni de shu ju ku zhong you ke neng cun chu zhong wen zi fu de hua , jiu yao shi yong qian yi ge fang fa . xian zai ju yi ge shi ji de li zi , rang wo yi bu bu xue xi ru he shi yong CLOB. shou xian , chuang jian yi ge han CLOB zi duan de biao : create table test (id INTEGER, content clob); jie xia lai , wo men tong guo JSP wang zhe zhang biao li cha ru yi tiao ji lu , ran hou zai huo qu xian shi ta . cha ru cao zuo : yi shang xu yao zhu yi de ji dian shi : 1)clob lei xing de shu ju bu neng zhi jie insert, yao xian tong guo empty_clob() fang fa gei ta fen pei yi ge locator( tong li ,blob de yong empty_blob() han shu fen pei locator). ran hou ba ta select chu lai ( ci shi ta dang ran mei you shu ju , dan jie guo ji bu shi kong de ), de dao yi ge Clob de dui xiang , xiu gai gai dui xiang de nei rong rang ta man zu wo men de xu yao , zai tong guo update fang fa geng xin gai xing ji lu . 2) tong guo select xiu gai han lob lei xing de ji lu shi yi ding yao suo ding gai xing ( tong guo for update guan jian zi shi xian ), fou ze oracle hui bao cuo . 3) gang cha ru de ji lu jiu select for update, hui chu xian " wei fan du qu shun xu " cuo wu , jie jue ban fa shi jiang zi dong ti jiao gong neng zhi wei false, ji bu yuan xu zi dong ti jiao , ran hou commit ta , zai select, jiu ke yi le . zhe jiu shi shang mian na duan dai ma li //* liang xing de zuo yong . xia mian , wo men jiang gang cha ru de ji lu cong shu ju ku zhong du qu chu lai bing xian shi zhi : er 、 bian ma wen ti yin wei JAVA de kai fa zhe shi lao wai , suo yi ta men dui zhong wen de zhi chi bing bu shi tai hao , zhe yi dian rang bu shao de wo men gan dao hen shi tou tong , ye jiu shi wo men tong guo shuo de han zi bian ma wen ti ba , guan yu yi xie han zi bian ma de gui fan wo jiu bu duo shuo le , wo zhu yao shi tan tan zai he oracle shu ju ku lian jie shi de yi xie xiao wen ti , bu guo zhe xie xiao wen ti hen shi rang ren tou tong de 。 1、 zai cha ru dao shu ju ku zhong de zhong wen wen ti yao zhuan huan cheng bian ma 2、 cong shu ju ku zhong du dao zhong wen you yao zhuan huan cheng bian ma rang wo men kan yi ge bian ma de JAVA dai ma :   //ECov.java   import java.io.UnsupportedEncodingException;   public class ECov   {   public static String asc2gb(String asc){   String ret;   if(asc==null)return asc;   try{   ret=new String(asc.getBytes("ISO8859_1"),"GB2312");   }   catch(UnsupportedEncodingException e){   ret=asc;   }   return ret;   }   public static String gb2asc(String gb){   String ret;   if(gb==null)return gb;   try{   ret=new String(gb.getBytes("GB2312"),"ISO8859_1");   }   catch(UnsupportedEncodingException e){   ret=gb;   }   return ret;   }   public static int byte2int(byte b){   return ((-1)>>>24)&b;   }   } qi shi zhe duan dai ma de yi si ye jiu shi ba liang zhong fang fa he er wei yi le 。 zai jin xing shu ju ku cha ru shi yao yong ECov.gb2asc(arg), yao zai du shi yao yong ECov.asc2gb(arg)。 qi zhong zui guan jian de yi dian jiu shi Oracle hao xiang zhi ren shi ISO8859_1 zhe zhong ge shi de bian ma ba ( jin shi wo de xiang fa )。 san 、 yi xie xiao xi jie 1、 jiu shi setAutoCommit(true or false), jiu shi wo men zai sqlPlus zhong chang yong commit() de gong neng , ru guo shi yong true, jiu bu yao yong commit(), fou ze huan shi yong commit() fang fa de 。 2、 dui ri qi lei xing de chu li , qi shi ta bing bu shi xiang xiang zhong setDate(),getDate() na me jian dan de , zhong jian you hen da de lou dong 。 da jia zi ji duo tiao shi jiu hui jiao de you hen duo de le qu de 。 3、 zai he shu ju ku zhong zui hao shi cai yong lian jie chi ji shu , yong biao zhun de J2EE de huan jing , yong jian dan de JNDI ji shu , shi hen hao de yi zhong fang fa de 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
上海柏雅居酒店模拍
清晨美丽的风景
梦清园的靓丽女生
妖艳的食人花(7)
且行且攝------"色"影大連
【做股票的朋友看过来-华尔街的铜牛】
端午节后闲逛
捐款赈灾吴川行 花絮
 
>>返回首页<<
 为你推荐
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
©2005- 王朝网络 版权所有