---------------------将大量数据写入Clob字段中-------------
一。得到连接
def dbDriver = "oracle.jdbc.driver.OracleDriver";
def url = "jdbc:oracle:thin@xxx
def username = "foi";
def password = "foi";
Connection conn = null;
Class.forName(dbDriver);
DriverManager.setLoginTimeout(30);
conn = DriverManager.getConnection(url, username, password);
二。写sql语句
def sql=""" update notice set title=?,publish_time=?,info_body=? where id=1""";
三。预编译
def title=params.title;
def infoBody=params.infoBody;
def publishTime="2012-12-12"
def pstm=conn.prepareStatement(sql);
Reader clobReader = new StringReader(infoBody);
pstm.setString(1,title);
pstm.setString(2, publishTime);
pstm.setCharacterStream(3, clobReader,infoBody.length());
pstm.executeUpdate();