vendredi 4 mars 2016

how to call connection to sqlite method in jsf

I'm stuck on how to call connection to sqlite method in jsf.

The code below works fine in java. But how to work with in jsf .

public Connection getConnection(){
    Connection connection= null;


    try {
        Class.forName("org.sqlite.JDBC");


        connection = DriverManager.getConnection("jdbc:sqlite: file db path");
       System.out.println("Connection completed.");
    } catch (Exception e) {
        e.printStackTrace();
    }

    return connection;
 }

Aucun commentaire:

Enregistrer un commentaire