对于long型的,使用下面的方法。
String sSql = "INSERT INTO news VALUES(??)";PreparedStatement pstmt = con.prepareStatement(sSql);
String title=request.getParameter("title");
String content=request.getParameter("txt");
byte[] pic = content.getBytes("8859_1");
ByteArrayInputStream baisss = new ByteArrayInputStream(pic);
InputStreamReader bais = new InputStreamReader(baisss,"8859_1");
pstmt.setString(1,title);
pstmt.setCharacterStream(2,bais,pic.length);
pstmt.execute();
String sSql = "INSERT INTO news VALUES(??)";PreparedStatement pstmt = con.prepareStatement(sSql);
String title=request.getParameter("title");
String content=request.getParameter("txt");
byte[] pic = content.getBytes("8859_1");
ByteArrayInputStream baisss = new ByteArrayInputStream(pic);
InputStreamReader bais = new InputStreamReader(baisss,"8859_1");
pstmt.setString(1,title);
pstmt.setCharacterStream(2,bais,pic.length);
pstmt.execute();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货