Search in sources :

Example 6 with InstantConverter

use of net.runelite.http.service.util.InstantConverter in project runelite by runelite.

the class SpringBootWebApplication method sql2o.

@Bean("Runelite SQL2O")
Sql2o sql2o() throws NamingException {
    DataSource dataSource = (DataSource) getContext().lookup("jdbc/runelite");
    Map<Class, Converter> converters = new HashMap<>();
    converters.put(Instant.class, new InstantConverter());
    return new Sql2o(dataSource, new NoQuirks(converters));
}
Also used : HashMap(java.util.HashMap) InstantConverter(net.runelite.http.service.util.InstantConverter) Converter(org.sql2o.converters.Converter) InstantConverter(net.runelite.http.service.util.InstantConverter) NoQuirks(org.sql2o.quirks.NoQuirks) Sql2o(org.sql2o.Sql2o) DataSource(javax.sql.DataSource) Bean(org.springframework.context.annotation.Bean)

Aggregations

HashMap (java.util.HashMap)6 InstantConverter (net.runelite.http.service.util.InstantConverter)6 Bean (org.springframework.context.annotation.Bean)6 Sql2o (org.sql2o.Sql2o)6 Converter (org.sql2o.converters.Converter)6 NoQuirks (org.sql2o.quirks.NoQuirks)6 DataSource (javax.sql.DataSource)3