@Override protected DataSource createDataSource(Map params, SQLDialect dialect) throws IOException { SQLiteConfig config = new SQLiteConfig(); config.setSharedCache(true); config.enableLoadExtension(true); // support for encrypted databases has been ddded after 3.20.1, we'll have to // wait for a future release of sqlite-jdbc // if(password != null) { // config.setPragma(SQLiteConfig.Pragma.PASSWORD, password); // } // TODO: add this and make configurable once we upgrade to a sqlitejdbc exposing mmap_size // config.setPragma(SQLiteConfig.Pragma.MMAP_SIZE, String.valueOf(1024 * 1024 * 1000)); // use native "pool", which is actually not pooling anything (that's fast and // has less scalability overhead) SQLiteConnectionPoolDataSource ds = new SQLiteConnectionPoolDataSource(config); ds.setUrl(getJDBCUrl(params)); return ds; }
/** * This is left for public API compatibility but it's not as efficient as using the GeoPackage * internal pool * * @param params Map of connection parameter. * @return * @throws IOException */ @Override public BasicDataSource createDataSource(Map params) throws IOException { // create a datasource BasicDataSource dataSource = new BasicDataSource(); // driver dataSource.setDriverClassName(getDriverClassName()); // url dataSource.setUrl(getJDBCUrl(params)); addConnectionProperties(dataSource, params); dataSource.setAccessToUnderlyingConnectionAllowed(true); return dataSource; }
@Override protected DataSource createDataSource(Map params, SQLDialect dialect) throws IOException { SQLiteConfig config = new SQLiteConfig(); config.setSharedCache(true); config.enableLoadExtension(true); String password = (String) PASSWD.lookUp(params); // support for encrypted databases has been ddded after 3.20.1, we'll have to // wait for a future release of sqlite-jdbc // if(password != null) { // config.setPragma(SQLiteConfig.Pragma.PASSWORD, password); // } // TODO: add this and make configurable once we upgrade to a sqlitejdbc exposing mmap_size // config.setPragma(SQLiteConfig.Pragma.MMAP_SIZE, String.valueOf(1024 * 1024 * 1000)); // use native "pool", which is actually not pooling anything (that's fast and // has less scalability overhead) SQLiteConnectionPoolDataSource ds = new SQLiteConnectionPoolDataSource(config); ds.setUrl(getJDBCUrl(params)); return ds; }
/** * This is left for public API compatibility but it's not as efficient as using the GeoPackage * internal pool * * @param params Map of connection parameter. * @return * @throws IOException */ @Override public BasicDataSource createDataSource(Map params) throws IOException { // create a datasource BasicDataSource dataSource = new BasicDataSource(); // driver dataSource.setDriverClassName(getDriverClassName()); // url dataSource.setUrl(getJDBCUrl(params)); addConnectionProperties(dataSource, params); dataSource.setAccessToUnderlyingConnectionAllowed(true); return dataSource; }