package com.zkdx.hangul_service.test;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
public class Test {
public static void main(String[] args) throws Exception {
Class.forName("com.mysql.cj.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT";
String user = "root";
String password = "123456abc";
Connection connection = DriverManager.getConnection(url, user, password);
for (int i = 10; i < 300; i++) {
String sql = "insert into jc_my_content(content_id,title,content,ImagePath) values(?,?,?,?)";
PreparedStatement preparedStatement = connection.prepareStatement(sql);
preparedStatement.setInt(1, i);
preparedStatement.setString(2, i + "");
preparedStatement.setString(3, i + "");
preparedStatement.setString(4, i + "");
int row = preparedStatement.executeUpdate();
}
}
}