Gå til hovedinnhold

Grunnleggende modus - JDBC-kilde

Importer JDBC-modul fra Trevas

<dependency>
<groupId>fr.insee.trevas</groupId>
<artifactId>vtl-jdbc</artifactId>
<version>1.7.0</version>
</dependency>

Bruke vtl-jdbc modulen

connection = DriverManager.getConnection(...);

Statement statement = connection.createStatement();

JDBCDataset jdbcDataset = new JDBCDataset(() -> {
try {
return statement.executeQuery("select * from ds1;");
} catch (SQLException se) {
throw new RuntimeException(se);
}
});