0

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;
 }
  • The MVC (Model-View-Controller) approach recommends that business code (BD connection) is to be put in the Model side (for example : java beans classes). Take a look here : [Understanding JSF as a MVC framework](http://stackoverflow.com/questions/10111387/understanding-jsf-as-a-mvc-framework) then, [What components are MVC in JSF MVC framework?](http://stackoverflow.com/questions/5104094/what-components-are-mvc-in-jsf-mvc-framework). – Omar Mar 04 '16 at 14:19
  • Thanks for the reply. Actually, I'm working with MVC approch in my project, that's fine. And i'm using mysql as database. But I want also to include sqlite db for only to extract chrome browser history. @Omar – user2096996 Mar 04 '16 at 14:33

0 Answers0