public class SQLStatement extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SQLStatement.Tag
Tags that may condition execution of the statement.
|
Modifier and Type | Field and Description |
---|---|
static String |
CATEGORY
Category pseudo-tag
|
static String |
DIALECT_WITH_NO_SEMICOLON |
String |
sql
SQL statement
|
List<SQLStatement.Tag> |
tags
Tags on the statement
|
Constructor and Description |
---|
SQLStatement(String sql,
List<SQLStatement.Tag> tags) |
Modifier and Type | Method and Description |
---|---|
static void |
execute(List<SQLStatement> statements,
Map<String,Serializable> properties,
JDBCConnection jdbc)
Executes a list of SQL statements, following the tags.
|
static Map<String,List<SQLStatement>> |
read(String filename,
Map<String,List<SQLStatement>> statements)
Reads SQL statements from a text file.
|
String |
toString() |
public static final String DIALECT_WITH_NO_SEMICOLON
public static final String CATEGORY
public final String sql
public final List<SQLStatement.Tag> tags
public SQLStatement(String sql, List<SQLStatement.Tag> tags)
public static Map<String,List<SQLStatement>> read(String filename, Map<String,List<SQLStatement>> statements) throws IOException
Statements have a category, and optional tags (that may condition execution).
#CATEGORY: mycat #TEST: SELECT foo from bar;
#CATEGORY: mycat #IF: emptyResult #IF: somethingEnabled INSERT INTO ...;An empty line terminates a statement.
IOException
public static void execute(List<SQLStatement> statements, Map<String,Serializable> properties, JDBCConnection jdbc) throws SQLException
SQLException
Copyright © 2011 Nuxeo SA. All Rights Reserved.