java.lang.ClassNotFoundException:com.mysql.jdbc.Driver
出现此错误的原因是没有将Mysql的jar包放进project中,如下图:
java.sqlexception:Can not issue data manipulation statements with executeQuery()
出现此错误的原因是在使用update和insert语句时不应像select语句一样使用executeQuery,而应使用execute。
java.sql.SQLException: Before start of result set
出现此错误的原因是没有使用while语句rs.next()进行循环。