private static String BYTEMAP[];
static
{
BYTEMAP = new String[256];
int i = 0;
do
{
BYTEMAP
= String.valueOf(Integer.toHexString(i / 16)) + String.valueOf(Integer.toHexString(i % 16));
} while (++i < 256);
}
public static String cite(byte abyte0[])
{
if (abyte0 == null)
{
return "null";
}
StringBuffer stringbuffer = new StringBuffer("0x");
for (int i = 0; i < abyte0.length; i++)
{
stringbuffer.append(BYTEMAP[0xff & abyte0]);
}
return stringbuffer.toString();
}
public static void main(String args[])
{
java.sql.Statement statement=null;
byte picture[]=null;
......
statement.executeUpdate("INSERT INTO tab1(picture)VALUES("+cite(picture)+")");
.....
}
搜索更多相关主题的帖子: