Package io.ultreia.java4all.util.sql
Class SqlScriptConsumer
- java.lang.Object
-
- io.ultreia.java4all.util.sql.SqlScriptConsumer
-
- All Implemented Interfaces:
SqlWork,Closeable,AutoCloseable,Consumer<Connection>
public class SqlScriptConsumer extends Object implements SqlWork, Closeable, Consumer<Connection>
To consume an incoming sql script into a topia persistence database.Created by tchemit on 10/05/2018.
- Since:
- 1.1.0
- Author:
- Tony Chemit - dev@tchemit.fr
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSqlScriptConsumer.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Connection connection)static SqlScriptConsumer.Builderbuilder(byte[] source)static SqlScriptConsumer.Builderbuilder(SqlScript source)static SqlScriptConsumer.Builderbuilder(SqlScriptReader source)static SqlScriptConsumer.Builderbuilder(String source)static SqlScriptConsumer.Builderbuilder(URL source)static SqlScriptConsumer.Builderbuilder(Path source)voidclose()voidexecute(Connection connection)Execute the discrete work encapsulated by this work instance using the supplied connection.longgetStatementCount()static SqlScriptConsumerof(byte[] source)static SqlScriptConsumerof(SqlScript source)static SqlScriptConsumerof(String source)static SqlScriptConsumerof(URL source)static SqlScriptConsumerof(Path source)
-
-
-
Method Detail
-
of
public static SqlScriptConsumer of(String source)
-
of
public static SqlScriptConsumer of(byte[] source)
-
of
public static SqlScriptConsumer of(Path source)
-
of
public static SqlScriptConsumer of(URL source)
-
of
public static SqlScriptConsumer of(SqlScript source)
-
builder
public static SqlScriptConsumer.Builder builder(String source)
-
builder
public static SqlScriptConsumer.Builder builder(byte[] source)
-
builder
public static SqlScriptConsumer.Builder builder(Path source)
-
builder
public static SqlScriptConsumer.Builder builder(URL source)
-
builder
public static SqlScriptConsumer.Builder builder(SqlScript source)
-
builder
public static SqlScriptConsumer.Builder builder(SqlScriptReader source)
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
execute
public void execute(Connection connection) throws SQLException
Description copied from interface:SqlWorkExecute the discrete work encapsulated by this work instance using the supplied connection.- Specified by:
executein interfaceSqlWork- Parameters:
connection- The connection on which to perform the work.- Throws:
SQLException- Thrown during execution of the underlying JDBC interaction.
-
accept
public void accept(Connection connection)
- Specified by:
acceptin interfaceConsumer<Connection>
-
getStatementCount
public long getStatementCount()
-
-