|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.microfocus.cobol.lang.CobolDate
Java class for a CobolDate field
Copyright: Copyright (c) 2002-2003
| Constructor Summary | |
CobolDate()
Construct a CobolDate using the current time and default encoding |
|
CobolDate(Date sqlDate)
Construct a CobolDate type with a given date and the default encoding |
|
CobolDate(Date sqlDate,
String encoding)
Construct a CobolDate type with a given date and a given encoding |
|
| Method Summary | |
byte[] |
getBytes()
getBytes() public method to return bytes[] representation of a CobolDate field |
String |
getEncoding()
get the current encoding |
void |
synchronizeData()
public method called by the COBOL Runtime to allow the CobolDate instance to update its Java represenation of the CobolDate field. |
String |
toString()
returns a String representation of the CobolDate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public CobolDate()
public CobolDate(Date sqlDate)
long milliseconds = System.currentTimeMillis();
CobolDate sqlDate= new CobolDate(new Date(milliseconds));
RuntimSystem.cobcall("showdate",ParameterList().add(sqlDate));
and showdate.cbl is:
working-storage section.
linkage section.
01 jsql-date.
03 jyear pic 9(4).
03 filler pic x.
03 jmonth pic 99.
03 filler pic x.
03 jday pic 99.
procedure division using jsql-date.
display "COBOL -> " jsql-date.
add 100 to jyear
exit program returning 0.
*
sqlDate - a java.sql.Date
public CobolDate(Date sqlDate,
String encoding)
throws UnsupportedEncodingException
long milliseconds = System.currentTimeMillis();
CobolDate sqlDate= new CobolDate(new Date(milliseconds),,"Cp500"));
RuntimSystem.cobcall("showdate",ParameterList().add(sqlDate));
and showdate.cbl is:
$set charset(ebcdic) initcall(utils)
working-storage section.
linkage section.
01 jsql-date.
03 jyear pic 9(4).
03 filler pic x.
03 jmonth pic 99.
03 filler pic x.
03 jday pic 99.
procedure division using jsql-date.
display "COBOL -> " jsql-date.
add 100 to jyear
exit program returning 0.
*
Note: Cp500 is java code page, so it may not contain all european ebcdic characters
sqlDate - a java.sql.Dateencoding - a valid encoding
UnsupportedEncodingException| Method Detail |
public byte[] getBytes()
throws CobolException,
Exception
getBytes in interface DataTypeCobolException
Exception
public void synchronizeData()
throws CobolException,
Exception
synchronizeData in interface DataTypeCobolException
Exceptionpublic String getEncoding()
public String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright © 2000 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.