在表中建立一xmltype字段,在xmltype选项中选择不基于方案的时候不能存入比较大的xml数据,只能存储较小的数据,据说是4k以下的,存较大的需要建临时的clob类型,倒一下;
在选择基于xml方案时,选择XDB方案,存储为clob类型,不知该怎样存储数据(写pL语句)。
如果存入大的数据时,也需要用clob倒那么如何倒呢?
在选择基于xml方案时,选择XDB方案,存储为clob类型,不知该怎样存储数据(写pL语句)。
如果存入大的数据时,也需要用clob倒那么如何倒呢?
解决方案 »
- 关于添加java sourse的问题
- 银行里的数据库是用漏洞较多Oracle吗?
- #emca -config dbcontrol db -repos create后OEM提示:无法连接到数据库实例。在线等。
- 帮帮我,我的oracleconsoleorcl service为什么启动失败。
- 100分 求sql语句!急急急!!!!!
- oracle 有没有left函数?
- 关于一个SQL语句!简单!!谢谢大家了!!
- 触发器执行出错,请帮忙看看。谢谢
- oracle 行转列
- oracle中如何对如等级标准等信息进行良好设计【求大神来约】
- 各位高手,请看看我的存储过程有什么问题啊?高分求助,快速给分,呵呵
- 出现Cannot load the DBMS ORACLE Version 9i!! please choose another one .错误,求高手指教
//用于处理大于4k字节的xml
private CLOB getCLOB(Document xmlData) throws SQLException {
CLOB tempClob = null;
try {
// If the temporary CLOB has not yet been created, create one tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION); // Open the temporary CLOB in readwrite mode, to enable writing
tempClob.open(CLOB.MODE_READWRITE);
// Get the output stream to write Writer tempClobWriter = tempClob.getCharacterOutputStream(); System.out.println(tempClobWriter.getClass().toString());
XMLWriter writer = new XMLWriter(tempClobWriter); writer.write(xmlData);
writer.flush();
writer.close(); // tempClobWriter.write(xmlData); // Flush and close the stream
// tempClobWriter.flush();
// tempClobWriter.close(); // Close the temporary CLOB
tempClob.close();
}
catch (SQLException sqlexp) {
tempClob.freeTemporary();
sqlexp.printStackTrace();
}
catch (Exception exp) {
tempClob.freeTemporary();
exp.printStackTrace();
}
return tempClob;
}
"XMLType(?))";
pstmt = conn.prepareStatement(insertgml);
clob = getCLOB(gml);
pstmt.setFloat(6, ymax);
pstmt.setObject(7, clob);