Project

General

Profile

« Previous | Next » 

Revision 1750

Added by Jing Tao over 21 years ago

using toDate method rather than to_date function directly.

View differences:

src/edu/ucsb/nceas/metacat/AccessControlList.java
505 505
      pstmt = connection.prepareStatement(
506 506
              "INSERT INTO xml_access " + 
507 507
              "(docid, principal_name, permission, perm_type, perm_order," +
508
              "begin_time,end_time,ticket_count, accessfileid) VALUES " +
509
              "(?,?,?,?,?,to_date(?,'mm/dd/yy'),to_date(?,'mm/dd/yy'),?,?)");
508
              "ticket_count, accessfileid) VALUES " +
509
              "(?,?,?,?,?,?,?)");
510
      MetaCatUtil.debugMessage("1, new sql for todate:================== ", 1);
510 511
      // Increase DBConnection usage count
511 512
      connection.increaseUsageCount(1);
512 513
      // Bind the values to the query
......
514 515
      pstmt.setInt(3, permission);
515 516
      pstmt.setString(4, permType);
516 517
      pstmt.setString(5, permOrder);
517
      pstmt.setString(6, beginTime);
518
      pstmt.setString(7, endTime);
519
      pstmt.setString(9, aclid);
518
      pstmt.setString(7, aclid);
520 519
      if ( ticketCount > 0 ) {
521
        pstmt.setString(8, "" + ticketCount);
520
        pstmt.setString(6, "" + ticketCount);
522 521
      } else {
523
        pstmt.setString(8, null);
522
        pstmt.setString(6, null);
524 523
      }
525 524
      
526 525
      //incrase usagecount for DBConnection

Also available in: Unified diff