为什么不在oracle中更新jdbc语句执行?

时间:2013-07-16 17:13:52

标签: java oracle jdbc parameters nested

我想在java(eclips)中执行下面的代码 但我在ide中没有错误,没有更新oracle中的任何行

代码下面的

是update_method

public void setUpdate(String statement,String par1,String par2)throws Exception

{
  System.out.println("this is setUpdate method"+statement);
  con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","ALBALOO","myjava123");
  st =con.prepareStatement(statement);
  st.setString(1, par1);
  st.setString(2,par2);
  st.executeUpdate();
  // con.commit();
 }

以下是调用方法

st="update newslables3 set nlable='1' where hhmm in (SELECT hhmm FROM newslables3 where hhmm not between '0830' and '1130') and yymmdd between ? and ? ";       
              db.setUpdate(st,priceSet[i][3],priceSet[i+1][3]);

我的oracle版本是10g xe

0 个答案:

没有答案