public class SqlFileEmbedder
extends java.lang.Object
Suitable for using as a template.
This class also serves as an example of using RCData to allow your application users to store JDBC access information in a convenient text file.
main(String[]),
SqlFile,
RCData| Constructor and Description |
|---|
SqlFileEmbedder(java.io.File rcFile,
java.lang.String urlid)
Instantiates SqlFileEmbedder object and connects to specified database.
|
| Modifier and Type | Method and Description |
|---|---|
void |
executeFiles(java.lang.String[] fileStrings)
Your own classes can use this method to execute SQL files.
|
java.sql.Connection |
getConn()
For applications that use a persistent JDBC connection, this class can
be used to encapsulate that connection.
|
static void |
main(java.lang.String[] sa)
Run
|
public SqlFileEmbedder(java.io.File rcFile,
java.lang.String urlid)
throws java.lang.Exception
N.b., you do not need to use RCData to use SqlFile. All SqlFile needs is a live Connection. I'm using RCData because it is a convenient way for a non-contained app (i.e. one that doesn't run in a 3rd party container) to get a Connection.
rcFile - Fileurlid - Stringjava.lang.Exception - on any problempublic java.sql.Connection getConn()
public static void main(java.lang.String[] sa)
throws java.lang.Exception
java SqlFileEmbedderto see Syntax message.
sa - String[]java.lang.Exception - on any problempublic void executeFiles(java.lang.String[] fileStrings)
throws java.io.IOException,
org.hsqldb.cmdline.SqlToolError,
java.sql.SQLException
See source code for the main(String[]) method for an example of calling this method.
fileStrings - String[]java.io.IOException - on io problemsorg.hsqldb.cmdline.SqlToolError - on SQL Tool problemsjava.sql.SQLException - on SQL problemsmain(String[])Copyright © 2001 - 2018 HSQL Development Group.