Java利用Ibatis的ScriptRunner解析sql

需要导入mybatis-3.0.5.jar包
java直接解析sql: http://daoshud1.iteye.com/admin/blogs/1933308
java利用ant解析sql:[url]http://daoshud1.iteye.com/blog/1913149 [/url]
Connection conn = new TestServiceImpl().getConnection();
		ScriptRunner runner = new ScriptRunner(conn);
		try {
			runner.runScript(new InputStreamReader(new FileInputStream("g:\\m_acc_t_txtpassword-oracle-3.sql"),"UTF-8"));//防止读取时中文乱码
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			runner.closeConnection();
		}

你可能感兴趣的:(ibatis)