java¶ÁÈ¡mysqlÊý¾Ý¿âlatin1±ÜÃâÂÒÂë·½·¨
дÈëʱ£¬ÏÈ×öencode£º
public static String encode(String src) {
String result = null;
try {
result = new String(src.getBytes("gbk"), "ISO-8859-1");
} catch (UnsupportedEncodingException uee) {
System.err.println(uee);
}
return result;
}
¶Á³öʱ£¬ÔÙ×ödecode£º
public static String decode(String src) {
String result = null;
try {
result = new String(src.getBytes("ISO-8859-1"), "gbk");
} catch (UnsupportedEncodingException uee) {
System.err.println(uee);
}
return result;
}
Á¬½Óʱ²»ÐèÒªÖ¸¶¨×Ö·û¼¯
Ïà¹ØÎĵµ£º
×ðÖØÔ´´£¬±¾Ìùת×Ô:http://longsy.javaeye.com/blog/382880
µ±Êý×é×÷Ϊ·½·¨´«µÝ²ÎÊýʱ£¬¼ÙÈçÐè´¦Àí´ËÊý×飬ÔòÒ»°ãÓÐÁ½ÖÖ×ö·¨£¨ÒÔһάÊý×éΪÀý£©:
//µÚÒ»ÖÖ
public static int[] processArray1(int[] array) {
int[] tempArr = new int[array.length];
for(int i=0; i<array.length; i++) {
......
Õâ¶Îʱ¼äΪ¹«Ë¾ÄÚ²¿µÄÊý¾Ý´¦Àí¿ª·¢ÁËÒ»¸ö¹¤¾ß£¬Ç£Éæµ½ÔÚOracleÖм¯³ÉjavaÓ¦Óã¬×ܽáÁËһЩ¾Ñ飬ÒÔ¹©´ó¼Ò²Î¿¼ÁË£¡
³ÌÐò·ÖÁ½²¿·Ö£¬Ç°¶Ë½çÃæÓÉVB/VC¿ª·¢£¬Ö÷ҪʵÏÖÊý¾Ý´¦ÀíÅäÖü°³£¹æ¼Ç¼ÔËË㣬Õⲿ·ÖûÓÐʲôºÃ˵µÄÁË¡£
ºǫ́ÒÔOracleΪÊý¾Ý»ù´¡´¦ÀíÍÐ¹ÜÆ½Ì¨£¬ÔÚÊý¾Ý´¦Àí¹ý³ÌÖУ¬ÐèÒª¶ÔһЩÃû³Æ¡¢µØÖ·Ê²Ã´µÄ½øÐÐÕªÒªÌáÈ¡¡¢² ......
java ͨ¹ýSystem.getProperties()»ñȡϵͳ²ÎÊý
Properties props=System.getProperties(); //ϵͳÊôÐÔ
System.out.println("JavaµÄÔËÐл·¾³°æ±¾£º"+props.getProperty("java.version"));
System.out.println("JavaµÄÔËÐл·¾³¹©Ó¦ÉÌ£º"+props.getProperty("java.vendor"));
......
/*ÑÝʾһ¸öJDBC³ÌÐò£¬´ÓMysqlµÄLMDÊý¾Ý¿âÖжÁ³ö±íadminµÄÒ»¸öÐÅÏ¢*/
import java.sql.*;
public class TestMysqlConnection {
public static void main(String[] args) {
Connection conn = null;
Statement stmt = ......
ÒÔϵÄÎÄÕÂÊÇMySQL grantÓï·¨µÄÏêϸ½âÎö£¬Èç¹ûÄã¶ÔMySQL grantÓï·¨µÄÏà¹ØµÄʵ¼Ê²Ù×÷ÓÐÐËȤµÄ»°£¬Äã¾Í¿ÉÒÔ¶ÔÒÔϵÄÎÄÕµã»÷¹Û¿´ÁË¡£ÎÒÃÇ´ó¼Ò¶¼ÖªµÀMySQLÊý¾Ý¿â¸³ÓèÓû§È¨ÏÞÃüÁîµÄ¼òµ¥¸ñʽ¿É¸ÅÀ¨Îª£º
grant ȨÏÞ on Êý¾Ý¿â¶ÔÏó to Óû§
Ò»¡¢grant ÆÕͨÊý¾ÝÓû§£¬²éѯ¡¢²åÈë¡¢¸üС¢É¾³ý Êý¾Ý¿âÖÐËùÓбíÊý¾ÝµÄȨÀû¡£
grant ......