Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ConnectionFactory using sqlite driver
package com.tecgraf.plugins.server.dao.conf;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConnectionFactory {
public static Connection getConnection() {
try {
Class.forName ("org.sqlite.JDBC");
Connection connection = DriverManager.getConnection("jdbc:sqlite:plugins.db");
return connection;
} catch (ClassNotFoundException e) {
return null;
} catch (SQLException e) {
return null;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment