用JDBC连接Vertica数据库后插入一行数据的例子源代码(接上篇)
用JDBC连接Vertica数据库后插入一行数据的例子源代码(接上篇)
接上篇:用JDBC连接Vertica数据库的例子源代码
- conn = DriverManager.getConnection(
- "jdbc:vertica://docd04.verticacorp.com:5433/dbname", myProp);
- System.out.println("Connected!");
-
- //连接数据库成功后
-
Statement stmt = conn.createStatement();//建立声明对象 stmt.executeUpdate("INSERT INTO address_book " + "VALUES ('Smith', 'John', 'jsmith@example.com', " + "'555-123-4567')");//执行插入语句
- conn.close();
评论暂时关闭