All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.lab.helloworld.SQLiteInsert Maven / Gradle / Ivy

There is a newer version: 2.2.3
Show newest version
package com.lab.helloworld;

import java.sql.Connection;
import java.sql.Statement;

/**
 *
 * @author youyinnn
 *
 */
public class SQLiteInsert {

    public static void main(String[] args) throws Exception {
        Connection conn1 = MySQLiteUtils.getConn("test.db");

        Statement st1 = conn1.createStatement();

        String sql1 = "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)" +
                "VALUES (1,'paul',22,'California',30000) ;";

        Connection conn2 = MySQLiteUtils.getConn("test.db");

        Statement st2 = conn2.createStatement();

        String sql2 = "INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)" +
                "VALUES (2,'Jame',21,'Norway',50000) ;";

        st1.executeUpdate(sql1);
        st2.executeUpdate(sql2);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy