[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I want to use the DatabaseConfiguration class from Jakarta Commons
> Configuration ( http://jakarta.apache.org/commons/configuration/ )
> which takes a DataSource in its constructor.
> The problem is that i have no idea how to get such a thing

Hmm, perhaps I should provide one in the driver somehow. But as I
don't, it looks like a really easy thing to implement yourself.

class SQLiteDataSource implements DataSource {
    private String url;
    public SQLiteDataSource(String url) {
        Class.forName("org.sqlite.JDBC");
        this.url = url;
    }
    public Connection getConnection() {
        DriverManager.getConnection(url);
    }
    public Connection getConnection(String u, String p) { return
getConnection(); }
    public int getLoginTimeout() { return 0; }
    public void setLoginTimeout(int s) {}
    public PrintWriter getLogWriter() { return null; }
    public void setLogWriter(PrintWriter out) {}
}

If the package you're working with expects those last silly functions
to do something it would be pretty easy to fake it, but I suspect
you'll never need more than getConnection().

d

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLiteJDBC" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlitejdbc?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to