The CreateSchema
class of the SQL Statement Builder provides an entry point to defining a CREATE SCHEMA
SQL statement.
- Create an instance of the
CreateSchema
class through theStatementFactory
:
CreateSchema createSchema = StatementFactory.getInstance().createSchema("schemaName");
- Render the instance of
CreateSchema
class. Click here for more information on Rendering SQL Statement.
-
The complete example code
CreateSchema createSchema = StatementFactory.getInstance().createSchema("schemaName"); // optional step: add configuration StringRendererConfig config = StringRendererConfig.builder().lowerCase(true).build(); CreateSchemaRenderer renderer = CreateSchemaRenderer.create(config); createSchema.accept(renderer); String renderedString = renderer.render();