Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- connect to an in-memory database, you use the following connection string:
- jdbc:sqLite::memory
- public class Main {
- public static void main(String[] args) {
- try{
- Connection conn = DriverManager.getConnection("jdbc:sqlite:C:\Users\Owner\Desktop\School Project\Software-Engineering---Java-Project\Nati Elmaliach java\data.db");
- Statement statement = conn.createStatement();
- //CREATE TABLES
- statement.execute("CREATE TABLE IF NOT EXISTS CUSTOMERS (name TEXT,phone INTEGER,email TEXT)");
- //INSERT TO TABLES
- statement.execute("INSERT INTO CUSTOMERS (name,phone,email)" +
- "VALUES ('NETANEL', 05555555,'SADF@GMAIL')");
- statement.execute("INSERT INTO CUSTOMERS (name,phone,email)" +
- "VALUES ('BAR', 05554646,'RTGDG@GMAIL')");
- statement.execute("INSERT INTO CUSTOMERS (name,phone,email)" +
- "VALUES ('TOMER', 055646541,'ASDQWE@GMAIL')");
- statement.execute("INSERT INTO CUSTOMERS (name,phone,email)" +
- "VALUES ('LEIZY', 064646231,'ASD@GMAIL')");
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement