Package java.sql

Examples of java.sql.Time


        testConversion((byte) 1, 1.0d, Byte.class);
        testConversion((byte) 1, 1.0f, Byte.class);
        testConversion((byte) 1, BigInteger.ONE, Byte.class);
        testConversion((byte) 1, BigDecimal.ONE, Byte.class);
        testConversion(null, new Date(0), Byte.class);
        testConversion(null, new Time(0), Byte.class);
        testConversion(null, new Timestamp(0), Byte.class);
    }
View Full Code Here


        testConversion((short) 1, 1.0d, Short.class);
        testConversion((short) 1, 1.0f, Short.class);
        testConversion((short) 1, BigInteger.ONE, Short.class);
        testConversion((short) 1, BigDecimal.ONE, Short.class);
        testConversion(null, new Date(0), Short.class);
        testConversion(null, new Time(0), Short.class);
        testConversion(null, new Timestamp(0), Short.class);
    }
View Full Code Here

        testConversion(1, 1.0d, Integer.class);
        testConversion(1, 1.0f, Integer.class);
        testConversion(1, BigInteger.ONE, Integer.class);
        testConversion(1, BigDecimal.ONE, Integer.class);
        testConversion(null, new Date(0), Integer.class);
        testConversion(null, new Time(0), Integer.class);
        testConversion(null, new Timestamp(0), Integer.class);
    }
View Full Code Here

        testConversion(1L, 1.0f, Long.class);
        testConversion(1L, BigInteger.ONE, Long.class);
        testConversion(1L, BigDecimal.ONE, Long.class);
        testConversion(0L, new Date(0), Long.class);
        testConversion(10L, new Date(10), Long.class);
        testConversion(0L, new Time(0), Long.class);
        testConversion(10L, new Time(10), Long.class);
        testConversion(0L, new Timestamp(0), Long.class);
        testConversion(10L, new Timestamp(10), Long.class);
    }
View Full Code Here

        testConversion(BigInteger.ONE, 1.0d, BigInteger.class);
        testConversion(BigInteger.ONE, 1.0f, BigInteger.class);
        testConversion(BigInteger.ONE, BigInteger.ONE, BigInteger.class);
        testConversion(BigInteger.ONE, BigDecimal.ONE, BigInteger.class);
        testConversion(null, new Date(0), BigInteger.class);
        testConversion(null, new Time(0), BigInteger.class);
        testConversion(null, new Timestamp(0), BigInteger.class);
    }
View Full Code Here

        testConversion(new BigDecimal("1.0"), 1.0d, BigDecimal.class);
        testConversion(new BigDecimal("1.0"), 1.0f, BigDecimal.class);
        testConversion(BigDecimal.ONE, BigInteger.ONE, BigDecimal.class);
        testConversion(BigDecimal.ONE, BigDecimal.ONE, BigDecimal.class);
        testConversion(null, new Date(0), BigDecimal.class);
        testConversion(null, new Time(0), BigDecimal.class);
        testConversion(null, new Timestamp(0), BigDecimal.class);
    }
View Full Code Here

    protected final String zeroDate() {
        return new Date(0).toString();
    }

    protected final String zeroTime() {
        return new Time(0).toString();
    }
View Full Code Here

            if (java.sql.Date.class == type) {
                return new java.sql.Date(date);
            }
           
            if (Time.class == type) {
                return new Time(date);
            }
           
            if (Date.class == type) {
                return new Date(date);
            }
View Full Code Here

            if (java.sql.Date.class == type) {
                return new java.sql.Date(date.getTime());
            }
           
            if (Time.class == type) {
                return new Time(date.getTime());
            }
           
            if (Date.class == type) {
                return date;
            }
View Full Code Here

    // Set the milliseconds explicitly, otherwise the milliseconds from the
    // time the gc was initialized are used.
    gc.set(GregorianCalendar.MILLISECOND, 0);

    Date date = new Date(gc.getTimeInMillis());
    Time time = new Time(gc.get(GregorianCalendar.HOUR), gc.get(GregorianCalendar.MINUTE),
        gc.get(GregorianCalendar.SECOND));
    Timestamp timestamp = new Timestamp(
        gc.get(GregorianCalendar.YEAR) - 1900, gc.get(GregorianCalendar.MONTH),
        gc.get(GregorianCalendar.DAY_OF_MONTH), gc.get(GregorianCalendar.HOUR),
        gc.get(GregorianCalendar.MINUTE), gc.get(GregorianCalendar.SECOND), 0);
View Full Code Here

TOP

Related Classes of java.sql.Time

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.