List of utility methods to do JDBC Sqlite Connection
Connection | getSQLiteConnection() get SQ Lite Connection String fileName = "E:\\Java\\JavaEE\\SimpleWebApp\\WebContent\\sqlite.db"; return getSQLiteConnection(fileName); |
List | getUniqLabels() get Uniq Labels Connection c = null; Statement stmt = null; List<String> outputs = new ArrayList<String>(); try { Class.forName("org.sqlite.JDBC"); c = DriverManager.getConnection("jdbc:sqlite:dbs/newpress.db"); c.setAutoCommit(false); stmt = c.createStatement(); ... |
void | modify(String sql) modify Connection conn = getConnection(null); Statement st = null; try { st = conn.createStatement(); st.execute(sql); } catch (Exception e) { e.printStackTrace(); } finally { ... |
List | query(String sql) query List<Map<String, Object>> list = null; Connection conn = getConnection(null); Statement st = null; ResultSet rs = null; if (conn != null) { try { st = conn.createStatement(); rs = st.executeQuery(sql); ... |
void | removeLabel() remove Label Connection c = null; Statement stmt = null; try { Class.forName("org.sqlite.JDBC"); c = DriverManager.getConnection("jdbc:sqlite:dbs/newpress.db"); c.setAutoCommit(true); stmt = c.createStatement(); stmt.executeUpdate("DELETE from DOC_LABEL;"); ... |
void | runSetupScript(final String setupScriptPath) Load and run a SQL script. if (!checkConnection()) return; final boolean isSqlite = (dbURL.startsWith("jdbc:sqlite:")); FileReader fr = new FileReader(setupScriptPath); BufferedReader br = new BufferedReader(fr); List<String> sqls = new ArrayList<String>(); try { StringBuilder sb = new StringBuilder(); ... |