Modified the dateformat retrieved by the Java routine 'DirList' (MIP_DIRLIST.jsp). Previous version would generate an ORA-1850 when viewing files with a file modified time during the midnight hour.

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@16885 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
andrew.hardy
2010-03-24 11:46:28 +00:00
parent 61118404a8
commit a94562afc6

View File

@@ -1,4 +1,7 @@
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED DirList AS
create or replace and compile java source named dirlist as
//
//$Id$
//
import java.io.*;
import java.sql.*;
import java.util.Date;
@@ -28,14 +31,26 @@ import java.text.SimpleDateFormat;
String ftype;
String sqldate;
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd kk:mm:ss");
//
// ref: http://javatechniques.com/blog/dateformat-and-simpledateformat-examples/
//
// for date of 3rd January 2010, 23:05:09
// y = year: yyyy = 2010
// M = month number: MM = 01
// d = day in month: dd = 03
// H = Hour (0-23): HH = 23
// m = minute: mm = 05
// s = second: ss = 09
//
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (f.isFile()) {
len = f.length();
date = new Date(f.lastModified());
sqldate = df.format(date) ;
ftype = "F";
} else {