Open GF-Huang opened 8 years ago
Ok. Does it work for sqllite otherwise?
never try other, because i'm using sqlite and i must use it in my environment.
No, what I mean is, does it work ok for sqllite? Are you having any problems?
On Tue, May 3, 2016 at 1:28 PM, Great Fire Wall notifications@github.com wrote:
never try other, because i'm using sqlite and i must use it in my environment.
— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/dieselpoint/norm/issues/12#issuecomment-216621635
it's not work for sqlite. but I see https://github.com/brettwooldridge/HikariCP/issues/393, and make my code like this, it work fine. code:
import com.dieselpoint.norm.Database;
public final class Db extends Database {
@Override
protected DataSource getDataSource() throws SQLException {
HikariConfig config = new HikariConfig();
config.setDriverClassName("org.sqlite.JDBC");
config.setJdbcUrl("jdbc:sqlite:file.db");
config.setConnectionTestQuery("SELECT 1");
config.setMaximumPoolSize(100);
config.setInitializationFailFast(true); // optional
return new HikariDataSource(config);
}
}
main here:
Db db = new Db();
db.getConnection(); // work fine, and file.db will create.
sqlite do not need localhost
System.setProperty("norm.serverName", "localhost");