JavaÓïÑÔÈçºÎ·ÃÎʲ»Í¬×Ö·û¼¯µÄOracleÊý¾Ý
Ò»¡¢java·ÃÎÊÖÐÎÄOracleÊý¾Ý¿âÉÏÁ¬½ÓµÄUS7ASCIIÊý¾Ý¿â
1¡¢¶Á·½·¨
public String convertLink_DB(String s) {
if(s != null){
try{
byte[] b = s.getBytes();
for(int i=0; i<b.length; i++){
b[i] = (byte)(b[i]-128);
}
return new String(b, "gb2312");
}catch(Exception e){
e.printStackTrace();
return "";
}
}
return "";
}
2¡¢Ð´·½·¨
public String convertLink_DB(String s) {
if(s != null){
try{
byte[] b = s.getBytes();
for(int i=0; i<b.length; i++){
b[i] = (byte)(b[i]+128);
}
return new String(b, "gb2312");
}catch(Exception e){
e.printStackTrace();
return "";
}
}
return "";
}
Ò»¡¢java·ÃÎÊÓ¢ÎÄOracleÊý¾Ý¿â
1¡¢¶Á
new String(s, "gb2312");
2¡¢Ð´
new String(s, "8859-1");
Ïà¹ØÎĵµ£º
ÄÇÌì°á¼ÒµÄʱºò²Å·¢ÏÖÓкܶàµÄ¶«Î÷£¬»¹¼ÇµÃÎÒ¸ÕÀ´µ½±±¾©µÄʱºòÕÒÁË·¿×Ó¾ÍһֱסÔÚÕâÀï¡£¿ªÊ¼Ã¦Âµ×ÅÕÒ¹¤×÷¡£ÕÒµ½Õâ·Ý¹¤×÷µÄʱºò±¾À´ÊÇÏë»»×ÅÄØ£¬Ã¿Ìì¶¼ÊÇ×öһЩÎÄ×Ö¼ÈëµÄ¹¤×÷·¢³îµÄÎÒ£¬²»¹ýÔÚÕâÀïÒ²ÊÇÓз¢Õ¹µÄ»ú»á£¬ÓеÄʱºòÕûÀíһЩ¹ØÓÚÊý¾Ý·½ÃæµÄ£¬ÈÃÐÂÀ´µÄ°ÑÊý¾Ý¼Èëµ½µçÄÔÉÏ£¬ÎÒÃÇÒ²ÊÇ×öÍâ°üµÄ¡£µ«Ê ......
java»ñÈ¡µ±Ç°Â·¾¶[ת]
¹Ø¼ü×Ö: java ·¾¶
java »ñÈ¡µ±Ç°Â·¾¶
1 ¡¢ÀûÓà System.getProperty() º¯Êý»ñÈ¡µ±Ç°Â·¾¶£º
System.out.println(System.getProperty("user.dir"));//user.dir Ö¸¶¨Á˵±Ç°µÄ·¾¶
2 ¡¢Ê¹Óà File ÌṩµÄº¯Êý»ñÈ¡µ±Ç°Â·¾¶£º
File directory = new File("");// É趨Ϊµ±Ç°Îļþ ......
public static void main(String[] args)
{
Integer[] arrInt = new Integer[6];
arrInt[0] = 123;
arrInt[1] = 3453;
arrInt[2] = 345;
arrInt[3] = 23;
arrInt[4] = 11;
arrInt[5] = 345;
int temp = 0;
for (int i ......
JAVAÖлù±¾±äÁ¿¹²°üÀ¨£ºbyte,short,int,long,float,double,char,boolean,ÔÚ³ÌÐòÖÐÓõÄ×îÆÕ±é£¬×î¶à£¬µ«ÊÇËüÃǵÄһЩ¹Ø¼üÒ²¾³£±»ÎÒÃÇËùºöÂÔ£¬ÎÒ½ñÌì×ܽáÁËһϣ¬ÌùÔÚÕâÀï¡£¡£¡£
1.
±äÁ¿¶¨Ò壺
Ò»¸öÓɱêʶ·û¶¨ÒåµÄÊý¾ÝÏ°üÀ¨ÀàÐÍ¡¢Ãû³ÆºÍÖµÈý¸ö²¿·Ö
2.
±äÁ¿·ÖÀࣺ
Àà ......