📄 test.java~1~
字号:
// System.out.println(aa.toUpperCase().indexOf("MK"));
// }catch(Exception e){
// System.out.println(e);
// }
// Connection con = null;
// Statement stmt = null;
// ResultSet rs = null;
// int i=0;
// while(i<901)
// {
// try{
// con = getConnection();
// String sql="select content from tinfcont where infoID="+i;
// stmt = con.createStatement();
// rs = stmt.executeQuery(sql);
// if(rs.next()){
// String path = "/export/home/tmpdirectory/new/";
// InputStream sis = rs.getBinaryStream("content");
// java.io.DataInputStream dis = new java.io.DataInputStream(sis);
// java.io.File f = new java.io.File(path+i+".txt");
// java.io.FileOutputStream fos = new java.io.FileOutputStream(f);
//
// while (true) {
// try {
// fos.write(dis.readByte());
// } catch (EOFException e) {
// break;
// }
// }
// dis.close();
// fos.close();
// }
// }
// catch(Exception e){
// System.out.println(e);
// }finally{
// i++;
// stmt.close();
// con.close();
// }
// }
// }catch(Exception e){
// }
// try{
// java.sql.Date aaa=new java.sql.Date(System.currentTimeMillis());
// System.out.println(aaa);
// java.sql.Timestamp ttt=new java.sql.Timestamp(System.currentTimeMillis());
// System.out.println(ttt);
//
// Connection con = null;
// Statement stmt = null;
// java.sql.PreparedStatement pstmt=null;
// ResultSet rs = null;
// int i=0;
// while(i<901)
// {
// try{
// con = getConnection();
// String sql="select content from tinfcont where infoID="+i;
// stmt = con.createStatement();
// pstmt=con.prepareStatement(sql);
// pstmt.setTimestamp(1,tttt);
// rs = stmt.executeQuery(sql);
// if(rs.next()){
// String path = "/export/home/tmpdirectory/new/";
// PrintStream ps = new PrintStream(new FileOutputStream(path+i+".txt"));
// ps.println(rs.getString("content"));
// ps.flush();
// ps.close();
// }
// }
// catch(Exception e){
// System.out.println(e);
// }finally{
// i++;
// stmt.close();
// con.close();
// }
// }
// char c=0x554a;
// System.out.println(c);
// char m='哈';
// System.out.println((int)('哈'));
// byte[] b=new byte[16];
// b[0]=0x7f;
// b[1]=(byte)0xa4;
// b[2]=0x54;
// b[3]=(byte)0xc8;
// b[4]=0x6D;
// b[5]=0x4B;
// b[6]=(byte)0x8B;
// b[7]=(byte)0xD5;
// b[8]=0x00;
// b[9]=0x32;
// b[10]=0x00;
// b[11]=0x30;
// b[12]=0x00;
// b[13]=0x31;
// b[14]=0x00;
// b[15]=0x38;
// System.out.println(uncode(b));
// char[] c=new char[8];
// c[0]=0x7FA4;
// c[1]=0x53D1;
// c[2]=0x6D4B;
// c[3]=0x8BD5;
// c[4]=0x0032;
// c[5]=0x0030;
// c[6]=0x0031;
// c[7]=0x0038;
System.out.println((int)'啊');
System.out.println(uncode("554A"));
byte[] temp= "b0a1".getBytes();
System.out.println(new String(temp,"UTF-16BE"));
System.out.println("2003-07-10 郑州 天气预报:郑州今天白天到夜间阴,微风,最低气温22度,最高气温29度.(维他命C具有防止皮肤老化清除肌肤不洁物的功能)".substring(0,70));
}catch(Exception e){
System.out.println(e);
}
}
public static String uncode(byte[] bytedata) {
if(bytedata==null) return null;
char[] chardata=new char[bytedata.length/2];
int i,j;
i=0;
j=0;
while(i<bytedata.length){
chardata[j]=(char)(bytedata[i] & 0xff);
chardata[j]=(char)((chardata[j] << 8) | (bytedata[i+1] & 0xff));
i=i+2;
j=j+1;
}
return new String(chardata);
}
public static String uncode(String strInput) {
if (strInput == null) return null;
char[] chardata1=new char[strInput.length()];
System.out.println(strInput.length());
strInput.getChars(0, strInput.length(), chardata1, 0);
char[] chardata2=new char[chardata1.length/2];
System.out.println(chardata1.length);
System.out.println(chardata2.length);
int i,j;
i=0;
j=0;
while(i<chardata1.length){
chardata2[j]=(char)((chardata1[i]<<8) & 0xff00);
chardata2[j]=(char)((chardata1[i+1] & 0xff) | chardata2[j]);
i=i+2;
j=j+1;
}
return new String(chardata2);
}
/**
* When an object implementing interface <code>Runnable</code> is used
* to create a thread, starting the thread causes the object's
* <code>run</code> method to be called in that separately executing
* thread.
* <p>
* The general contract of the method <code>run</code> is that it may
* take any action whatsoever.
*
* @see java.lang.Thread#run()
*/
public void run() {
try{
// m_dbConn1 = getConnection();
}catch(Exception e){
System.out.println(e);
}finally{
try {
m_sk.close();
if (m_dbConn1 != null) {
m_dbConn1.close();
// ConnPoolHandler.closeConnection(m_dbConn);
}
} catch (Exception ee) {
System.out.println(ee);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -