Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8420669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:55:47+00:00 2026-06-10T02:55:47+00:00

This is a follow-on question to my earlier question about specifying multiple schemata in

  • 0

This is a follow-on question to my earlier question about specifying multiple schemata in java using jooq to interact with H2.

My test H2 DB currently has 2 schemata, PUBLIC and INFORMATION_SCHEMA. PUBLIC is specified as the default schema by H2. When running a query that should extract information from eg INFORMATION_SCHEMA.TABLES the query fails with a “table unknown” SQL error. I am only able to execute such queries by executing a factory.use(INFORMATION_SCHEMA). There are no build errors etc and eclipse properly autocompletes eg TABLES.TABLE_NAME.

If I dont do this, jooq doesnt seem to prepend the appropriate schema even though I create the correct Factory object for the schema eg

InformationSchemaFactory info = new InformationSchemaFactory(conn);

I read about mapping but am a bit confused as to which schema I would use as the input/output.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:55:48+00:00Added an answer on June 10, 2026 at 2:55 am

    By default, the InformationSchemaFactory assumes that the supplied connection is actually connected to the INFORMATION_SCHEMA. That’s why schema names are not rendered in SQL. Example:

    // This query...
    new InformationSchemaFactory(conn).selectFrom(INFORMATION_SCHEMA.TABLES).fetch();
    
    // ... renders this SQL (with the asterisk expanded):
    SELECT * FROM "TABLES";
    

    The above behaviour should be documented in your generated InformationSchemaFactory Javadoc. In order to prepend "TABLES" with "INFORMATION_SCHEMA", you have several options.

    1. Use a regular factory instead, which is not tied to any schema:

      // This query...
      new Factory(H2, conn).selectFrom(INFORMATION_SCHEMA.TABLES).fetch();
      
      // ... renders this SQL:
      SELECT * FROM "INFORMATION_SCHEMA"."TABLES";
      
    2. Use another schema’s factory, such as the generated PublicFactory:

      // This query...
      new PublicFactory(conn).selectFrom(INFORMATION_SCHEMA.TABLES).fetch();
      
      // ... renders this SQL:
      SELECT * FROM "INFORMATION_SCHEMA"."TABLES";
      
    3. Use Settings and an appropriate schema mapping to force the schema name to be rendered.

    The first option is probably the easiest one.

    This blog post here will give you some insight about how to log executed queries to your preferred logger output: http://blog.jooq.org/2011/10/20/debug-logging-sql-with-jooq/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow on from an earlier question about how to condense a
This is a follow-up question to this question I asked earlier. Btw thanks Neil
This is a follow-up to an earlier question I posted on EF4 entity keys
This is a follow up question to a previous question I asked about calculating
This is a follow-up to another question I asked earlier today. I am creating
This is somewhat of a follow up to a question posted earlier last month.
This is a follow-up to a question I'd asked earlier which phrased this as
I had an earlier question about integrating Mathematica with functions written in C++. This
As a follow-on to an earlier question about not reloading a huge, persistent table
This is a follow up question on my earlier question. Authentication based on Certificates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.