Tag: spring shell

IntelliJ中的CLI-Spring Shell

我正在使用IntelliJ中的CLI Spring shell代码。 我运行它并给出一些参数。 但是当我输入insert并按回车时,控制台不接受它,看起来好像什么也没发生! 我的代码: @Component public class HelloWorldCommands implements CommandMarker { @CliCommand(value = “insert”, help = “insert data to ParsEMS DB”) public void insert() { try { Class.forName(“org.postgresql.Driver”); Connection con = DriverManager.getConnection(“jdbc:postgresql://localhost:5432/ParsEMS”, “xxxxxx”, “xxxxxxx”); Statement st = con.createStatement(); st.executeUpdate(“INSERT INTO node (name, destination) VALUES (‘b’, 200)”); } catch (Exception e) { e.printStackTrace(); } […]