这个程序是用在WEB上的,所以控件派不上用场啊,
另外,输入端我会另求办法,关键是我总觉得这个查询语句是否是最优

解决方案 »

  1.   

    请使用PrepareStatment来进行动态查询.PreparedStatement ps = conn.prepareStatement("select * from table where columnA = ?");
    ps.setString(1, "input the condtion");
    ps.executeQuery();
    ......
      

  2.   

    同意楼上,用PrepareStatment可以满足你的要求
      

  3.   

    没有用过oracle,但我想其支持的功能要比Sqlserver强吧。
    在Sqlserver中可以采用自定义函数。
    函数有两个参数:年份,月份;
    返回值类型:Table这样所有关于数据处理的功能都集中在DB端,方便移植。
      

  4.   

    select * from log where TO_CHAR(logDate,'YYYY-MM') =  '2003-04'
      

  5.   

    tks  upc_chenli(chenli) 结贴
      

  6.   

    我觉得可以拼接字符串来形成可执行的SQL语句。
    例如:
    String beginDate="200203";//可以通过编程改变
    String endDate="200204";//可以改变
    String SQL="select * from log where logDate>=to_date('"+beginDate+"','yyyy-mm') and logDate<to_date('"+endDate+"','yyyy-mm')"