Revision 1751
Added by Jing Tao almost 21 years ago
AssociateAccessPolicy.java | ||
---|---|---|
451 | 451 |
insertStatement = conn.prepareStatement( |
452 | 452 |
"INSERT INTO xml_access " + |
453 | 453 |
"(docid, principal_name, permission, perm_type, perm_order,"+ |
454 |
"begin_time,end_time,ticket_count, accessfileid) VALUES "+ |
|
455 |
//"(?,?,?,?,?,to_date(?,'mm/dd/yy'),to_date(?,'mm/dd/yy'),?,?)"); |
|
456 |
"(?,?,?,?,?,?,?,?,?)"); |
|
454 |
"ticket_count, accessfileid) VALUES "+ |
|
455 |
"(?,?,?,?,?,?,?)"); |
|
457 | 456 |
// Bind the values to the query |
458 | 457 |
insertStatement.setString(1, docId); |
459 | 458 |
insertStatement.setString(2, principal); |
460 | 459 |
insertStatement.setInt(3, permission); |
461 | 460 |
insertStatement.setString(4, permType); |
462 | 461 |
insertStatement.setString(5, permOrder); |
463 |
insertStatement.setString(6, beginTime); |
|
464 |
insertStatement.setString(7, endTime); |
|
465 |
insertStatement.setString(9, accessFileId); |
|
462 |
insertStatement.setString(7, accessFileId); |
|
466 | 463 |
if ( ticketCount > 0 ) |
467 | 464 |
{ |
468 |
insertStatement.setString(8, "" + ticketCount);
|
|
465 |
insertStatement.setString(6, "" + ticketCount);
|
|
469 | 466 |
} |
470 | 467 |
else |
471 | 468 |
{ |
472 |
insertStatement.setString(8, null);
|
|
469 |
insertStatement.setString(6, null);
|
|
473 | 470 |
} |
474 | 471 |
insertStatement.execute(); |
475 | 472 |
hasRecord=rs.next(); |
Also available in: Unified diff
Get rid of to_date function.