Oracle会话级临时表的问题

gxqinjunde 2009-12-14 10:06:51
我在Oracle里创建了一个会话级的临时表,用Java代码获得一个数据连接,代码如下: public Connection getConnection() throws Exception {
Connection conn = null;
Context ctx = new InitialContext();
try {
if (appKey != null) {
ds = (DataSource) ctx.lookup(ERPJNDI); // java:comp/env/jdbc/sce
}
if (ds == null) {
throw new Exception(
"SCEHelper can't find the datasource for SCE Database. " +
"Please check the System Property");
}
} catch (Exception ex) {
ex.printStackTrace();
}

try {
if (ds != null) {
conn = ds.getConnection();
} else {
throw new Exception(
"SCEHelper can't find the datasource for SCE Database. " +
"Please check the System Property");
}

} catch (Exception ex) {
System.out.println(
"/***********************************************");
System.out.println(
" + ");
System.out.println(
" Connection Error !! ");
System.out.println(ex.toString() +
" ");
System.out.println(
"************************************************/");
throw ex;
}
return conn;
}
然后在其他代码中调用调用了那个临时表,取出运算后的数据,并且关闭连接,怎么我下次再运行程序的时候,原来临时表中的数据怎么还在啊。怎么会话级临时表的数据在连接断开后不会自动清除啊!
...全文
273 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
乔丹搞IT 2011-03-22
  • 打赏
  • 举报
回复
java用的连接池的会话。

62,635

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧