Package org.sql2o.converters

Examples of org.sql2o.converters.ConverterException


        if (val instanceof Datum){
            try {
                return new LocalDate (((Datum)val).dateValue());
            } catch (SQLException e) {
                throw new ConverterException(String.format("Error trying to convert oracle date to %s", LocalDate.class.getName()), e);
            }

        }

        return super.convert(val);
View Full Code Here


        if (val instanceof Datum){
            try {
                return new LocalTime (((Datum)val).timestampValue());
            } catch (SQLException e) {
                throw new ConverterException(String.format("Error trying to convert oracle time to %s", LocalTime.class.getName()), e);
            }
        }

        return super.convert(val);
    }
View Full Code Here

        if (val instanceof Datum) {
            try {
                return new DateTime(((Datum)val).timestampValue());
            } catch (SQLException e) {
                throw new ConverterException(String.format("Error trying to convert oracle timestamp to %s", DateTime.class.getName()), e);
            }
        }

        return super.convert(val);
    }
View Full Code Here

            // Joda has it's own pluggable converters infrastructure
            // it will throw IllegalArgumentException if can't convert
            // look @ org.joda.time.convert.ConverterManager
            return new LocalDate(val);
        } catch (IllegalArgumentException ex) {
            throw new ConverterException("Don't know how to convert from type '" + val.getClass().getName() + "' to type '" + LocalDate.class.getName() + "'", ex);
        }
    }
View Full Code Here

            // Joda has it's own pluggable converters infrastructure
            // it will throw IllegalArgumentException if can't convert
            // look @ org.joda.time.convert.ConverterManager
            return new LocalDateTime(val).toDateTime(timeZone);
        } catch (IllegalArgumentException ex) {
            throw new ConverterException("Error while converting type " + val.getClass().toString() + " to jodatime", ex);
        }
    }
View Full Code Here

            // Joda has it's own pluggable converters infrastructure
            // it will throw IllegalArgumentException if can't convert
            // look @ org.joda.time.convert.ConverterManager
            return new LocalTime(val);
        } catch (IllegalArgumentException ex) {
            throw new ConverterException("Don't know how to convert from type '" + val.getClass().getName() + "' to type '" + LocalTime.class.getName() + "'", ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.sql2o.converters.ConverterException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.