I did find it, and now I read it again... and still I am not smart enough to figure out how to use Conver utils.

example anyone ?

.V

Sgarlata Matt wrote:

Hi Vic, I might be missing something here but have you looked at this?

http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/package-summary.html#conversion.defining

I think the step you are missing is the call to the ConvertUtils.register()
method.

Matt
----- Original Message ----- From: "Vic Cekvenich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 19, 2003 10:33 AM
Subject: beanutils: how to convert string to date




I can write something like this:
public java.sql.Date getSMaxDate() {
    String _MaxDate = "1/1/1999";
SimpleDateFormat df = new SimpleDateFormat("mm/dd/yyyy");
java.util.Date du  = new java.util.Date();
try {
 du = df.parse(_MaxDate);
} catch (Exception e) { log.error("Date conversion error " + _MaxDate +
e);}
java.sql.Date d= new java.sql.Date(du.getTime());


return d; }


But... is there a way to do


Converter c = new SqlDateConverter();
d = c.convert (_MaxDate, java.sql.Date.class  );

I am looking at api and can;t figure how to use beanutils to make a
string into a SQL date.

Does someone have an example?

tia,
.V




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to