Thanks a lot for the response Lukas. I've looked over that documentation already.
I don't think I explained what I'm trying to do clearly. I'm trying to use JOOQ to dynamically write to a databases. That is, I don't know what database I'm using beforehand nor do I know the structure of the tables. Which is why I asked if was possible to use JOOQ to pull back database metadata easier than querying it through JDBC. I know schemaCrawler does this by supplying it with a connection. Pulling this data back will help me determine which type of converter to use. For example, if I have a jodatime object while writing to an oracle database, I want to see if I'm writing to a standard sql timestamp or an oracle specific TIMESTAMPTZ column. Code generation is not an option because the database being used is determined at run-time. Thanks a lot again and you've created a great tool, Jon On Saturday, November 10, 2012 1:29:00 AM UTC-8, Lukas Eder wrote: > > Hello Jon > > > What I'm confused on is how JOOQ handles writing to vendor specific data > > types like oracle's TIMESTAMPTZ. > > jOOQ generally uses those data types that are available through JDBC. > In this case, the best matching data type is probably > java.sql.Timestamp. > > > Also, if JOOQ does not handle a case where a column is a custom data > type > > like oracle's TIMESTAMPTZ, how do I use JOOQ to query and oracle table > to > > pull back the table's schema/metadata. > > The general approach would be to use jOOQ's code generator as > described in the tutorial: > > http://www.jooq.org/doc/2.6/manual/getting-started/tutorials/jooq-in-7-steps/ > > It will then generate the necessary meta data for type-safe data type > handling. Since you ultimately want to convert from / to jodatime > DateTime objects, you may want to consider the manual's sections about > custom data type conversion. This section explains what a converter > is: > > http://www.jooq.org/doc/2.6/manual/sql-execution/fetching/data-type-conversion/ > > > And this section explains how to let jOOQ's code generator apply > converters to generated meta data: > http://www.jooq.org/doc/2.6/manual/code-generation/custom-data-types/ > > Hope this helps, > Lukas >
