import java.sql.Connection;import java.sql.SQLException;/*** Function:* Time: 2021/10/29 13:43*/public class JDBCTest {public static void main(String[] args) throws SQLException {Connection itcaststore = JDBCUtils.getConnection("itcaststore");int row = 0;try {row = itcaststore.prepareStatement("insert into userinfor" +"(username, userpassword, gender, email, telephone)" +" VALUES ('陆俊','317499','男','3174919194','428912748')").executeUpdate();if (row>0){System.out.println("插入成功");}} catch (SQLException e) {System.out.println("插入失败");}}}
可以对插入操作是否成功做出判断。
