hi
i'm facing a problem while transferring date from csv to database.
my quary as follows
if (! firstdate.trim( ).equals("")) {
System.out.prin tln("insertInTo Database startdate "+startdate +" stopdate "+stopdate+"day "+Integer.parse Int(startdate
.substring(0, startdate.index Of('-')))+ "month"+(Intege r
.parseInt(start date.substring( startdate.index Of('-') + 1, startdate
.lastIndexOf('-'))) - 1)+"year"+Integ er.parseInt(sta rtdate
.substring(star tdate.lastIndex Of('-') + 1,
startdate.index Of(' '))));
Calendar cal = Calendar.getIns tance();
cal.set(Calenda r.DAY_OF_MONTH, Integer.parseIn t(startdate
.substring(0, startdate.index Of('-'))));
cal.set(Calenda r.MONTH, Integer
.parseInt(start date.substring(
startdate.index Of('-') + 1, startdate
.lastIndexOf('-'))) - 1);
cal.set(Calenda r.YEAR, Integer.parseIn t(startdate
.substring(star tdate.lastIndex Of('-') + 1,
startdate.index Of(' '))));
cal.set(Calenda r.HOUR, 0);
cal.set(Calenda r.MINUTE, 0);
cal.set(Calenda r.SECOND, 0);
System.out.prin tln("instartdat e");
System.out.prin tln("chq"+cal.g etTime().getTim e()+"hi"+cal.ge tTimeInMillis() +"hello");
//java.sql.Date d = new java.sql.Date(c al.getTimeInMil lis());
ps.setTimestamp (13, new java.sql.Timest amp ((cal.getTime() .getTime())));
but its showing that
ORA-01858: a non-numeric character was found where a numeric was expected
what should i do?
i'm facing a problem while transferring date from csv to database.
my quary as follows
if (! firstdate.trim( ).equals("")) {
System.out.prin tln("insertInTo Database startdate "+startdate +" stopdate "+stopdate+"day "+Integer.parse Int(startdate
.substring(0, startdate.index Of('-')))+ "month"+(Intege r
.parseInt(start date.substring( startdate.index Of('-') + 1, startdate
.lastIndexOf('-'))) - 1)+"year"+Integ er.parseInt(sta rtdate
.substring(star tdate.lastIndex Of('-') + 1,
startdate.index Of(' '))));
Calendar cal = Calendar.getIns tance();
cal.set(Calenda r.DAY_OF_MONTH, Integer.parseIn t(startdate
.substring(0, startdate.index Of('-'))));
cal.set(Calenda r.MONTH, Integer
.parseInt(start date.substring(
startdate.index Of('-') + 1, startdate
.lastIndexOf('-'))) - 1);
cal.set(Calenda r.YEAR, Integer.parseIn t(startdate
.substring(star tdate.lastIndex Of('-') + 1,
startdate.index Of(' '))));
cal.set(Calenda r.HOUR, 0);
cal.set(Calenda r.MINUTE, 0);
cal.set(Calenda r.SECOND, 0);
System.out.prin tln("instartdat e");
System.out.prin tln("chq"+cal.g etTime().getTim e()+"hi"+cal.ge tTimeInMillis() +"hello");
//java.sql.Date d = new java.sql.Date(c al.getTimeInMil lis());
ps.setTimestamp (13, new java.sql.Timest amp ((cal.getTime() .getTime())));
but its showing that
ORA-01858: a non-numeric character was found where a numeric was expected
what should i do?
Comment