Java Reference
In-Depth Information
* </pre>
* @throws SyntaxException
*/
@Deprecated
public
public
void
void
runScript
(
String scriptFile
)
throws
throws
IOException
,
SQLException
,
SyntaxException
{
BufferedReader is
;
// Load the script file first, it's the most likely error
is
=
new
new
BufferedReader
(
new
new
FileReader
(
scriptFile
));
runScript
(
is
,
scriptFile
);
}
/** Run one script, by name, given a BufferedReader.
* Deprecated because of the poor capability
* for error handling; it would be better for the
* user interface code to do:
* <pre>while ((stmt = SQLRunner.getStatement(is)) != null) {
stmt = stmt.trim();
try {
myRunner.runStatement(stmt);
} catch (Exception e) {
// Display the message to the user ...
}
}
* </pre>
* @throws SyntaxException
*/
@Deprecated
public
public
void
void
runScript
(
BufferedReader is
,
String name
)
throws
throws
IOException
,
SQLException
,
SyntaxException
{
String stmt
;
while
while
((
stmt
=
getStatement
(
is
)) !=
null
null
) {
stmt
=
stmt
.
trim
();
runStatement
(
stmt
);
}
}
/**
* Process an escape, like "\ms;" for mode=sql.
* @throws SyntaxException
*/
private
private
void
void
doEscape
(
String str
)