I am playing with some jooq code. I noticed to create sql using jooq it forces you to create a database connection. Wanted to know how to do this without a database connection:
String url = env.getProperty("spring.datasource.url");
String user = env.getProperty("spring.datasource.username");
String pass = env.getProperty("spring.datasource.password");
try (Connection conn = DriverManager.getConnection(url, user, pass)) {
DSLContext create = DSL.using(conn, SQLDialect.SQLSERVER2014);
String sql = create.select().from(DATA1).offset(100).limit(20).getSQL();
}
catch (Exception e) {
e.printStackTrace();
}