读文件操作应用
执行SQL脚本文件
/**
* 执行SQL脚本文件
* @param path
* @throws SQLException
* @throws ClassNotFoundException
*/
public void exeSQLScript(String path) throws SQLException, ClassNotFoundException
{
// 建立数据库连接
if ( this .conn == null || conn.isClosed())
openConn();
stmt = this .conn.createStatement();
// 读取文件
try
{
InputStream r = new FileInputStream(path);
ByteArrayOutputStream byteout = new ByteArrayOutputStream();
&n
* 执行SQL脚本文件
* @param path
* @throws SQLException
* @throws ClassNotFoundException
*/
public void exeSQLScript(String path) throws SQLException, ClassNotFoundException
{
// 建立数据库连接
if ( this .conn == null || conn.isClosed())
openConn();
stmt = this .conn.createStatement();
// 读取文件
try
{
InputStream r = new FileInputStream(path);
ByteArrayOutputStream byteout = new ByteArrayOutputStream();
&n

本文介绍如何使用Java进行文件读取并执行包含中文的SQL脚本,包括关键操作步骤和示例代码。

652

被折叠的 条评论
为什么被折叠?



