6月18日設置
Posted by No Name Ninja - 2008.07.29,Tue
private static Properties readProperties() {
Properties prop = new Properties();
InputStream is = null;
StringBuffer sb = new StringBuffer();
try {
ClassLoader cl = XXXXX.class.getClassLoader();
sb.append(((XXXXX.class).getPackage()).getName());
sb.append(System.getProperty("file.separator"));
sb.append("hoge.properties");
URL url = cl.getResource(new String(sb));
if (url != null) {
URLConnection urlConn = url.openConnection();
if (urlConn != null) {
urlConn.setUseCaches(false);
is = urlConn.getInputStream();
}
}
prop.load(is);
} catch (Exception e) {
e.printStackTrace();
}
return prop;
}
※ XXXXX はクラス名
PR
Posted by No Name Ninja - 2008.07.29,Tue
private static int HexToInt(String hexStr) {
char s[];
int i, wt, value;
wt = 1;
value = 0;
s = hexStr.toCharArray();
for (i = hexStr.length() - 1; i > -1; i--) {
switch (s[i]) {
case '0':
value += wt * 0;
break;
case '1':
value += wt * 1;
break;
case '2':
value += wt * 2;
break;
case '3':
value += wt * 3;
break;
case '4':
value += wt * 4;
break;
case '5':
value += wt * 5;
break;
case '6':
value += wt * 6;
break;
case '7':
value += wt * 7;
break;
case '8':
value += wt * 8;
break;
case '9':
value += wt * 9;
break;
case 'A':
value += wt * 10;
break;
case 'B':
value += wt * 11;
break;
case 'C':
value += wt * 12;
break;
case 'D':
value += wt * 13;
break;
case 'E':
value += wt * 14;
break;
case 'F':
value += wt * 15;
break;
}
wt *= 16;
}
return value;
}
Posted by No Name Ninja - 2008.07.29,Tue
private static String IntToHex(int value) {
char HEX[] = { Character.forDigit((value >> 4) & 0x0F, 16),
Character.forDigit(value & 0x0F, 16) };
String HexStr = new String(HEX);
return HexStr.toUpperCase();
}
Posted by No Name Ninja - 2008.07.29,Tue
use DATABASENAME
source tmp.sql
tmp.sql の中身は
set character_set_client=eucjpms;
set character_set_connection=eucjpms;
update ...
insert into ...
Posted by No Name Ninja - 2008.07.29,Tue
ダンプ
mysqldump DATABASENAME -u USERNAME -p >"/tmp/tmp.sql"
リストア
mysql -u USERNAME -p DATABASENAME <"/tmp/tmp.sql"
カレンダー
カテゴリー
フリーエリア
最新コメント
[05/16 backlink service]
最新記事
(09/18)
(11/17)
(10/03)
(07/21)
(07/20)
最新トラックバック
プロフィール
HN:
No Name Ninja
性別:
非公開
ブログ内検索
最古記事
カウンター
アクセス解析
Template by mavericyard*
Powered by "Samurai Factory"
Powered by "Samurai Factory"