代码如下:
...
sql="insert into webPageInfo (webAddrees,content) values(@, #)"
PreparedStatement pstmt = con.prepareStatement(sql)
pstmt.setString(1, thisURL)
pstmt.setString(2, Webtext)
ResultSet rs = pstmt.executeQuery()
向数据库中插入特殊字符,可以用PreparedStatement实现。代码如下:
...
sql="insert into webPageInfo (webAddrees,content) values(@, #)"
PreparedStatement pstmt = con.prepareStatement(sql)
pstmt.setString(1, thisURL)
pstmt.setString(2, Webtext)
ResultSet rs = pstmt.executeQuery()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)