Java JDBC Sqlite Connection getNewConnection(File dbFile)

Here you can find the source of getNewConnection(File dbFile)

Description

get New Connection

License

Open Source License

Declaration

protected static Connection getNewConnection(File dbFile) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;

public class Main {
    protected static Connection getNewConnection(File dbFile) {
        Connection c;/*from  w w w .j  a v a 2s .c  o m*/

        try {
            Class.forName("org.sqlite.JDBC");
            c = DriverManager.getConnection("jdbc:sqlite:" + dbFile.getAbsolutePath());
            return c;
        } catch (Exception e) {
            return null;
        }
    }
}

Related

  1. getConnection()
  2. getConnection(final String databaseName)
  3. getConnection(String dbFile)
  4. getConnection(String dbFilePath)
  5. getConnection(String dbName)
  6. getSenatorProp(String topicId)
  7. getSQLiteConnection()
  8. getUniqLabels()
  9. modify(String sql)