Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * $Id$
  * 
  * Firebird Open Source JavaEE Connector - JDBC Driver
  *
  * Distributable under LGPL license.
  * You may obtain a copy of the License at http://www.gnu.org/copyleft/lgpl.html
  *
  * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * LGPL License for more details.
 *
 * This file was created by members of the firebird development team.
 * All individual contributions remain the Copyright (C) of those
 * individuals.  Contributors to this file are either listed here or
 * can be obtained from a source control history command.
 *
 * All rights reserved.
 */
package org.firebirdsql.jdbc.field;

Supports object conversions as specified by JDBC.

In the current implementation the object conversions are specified in FBField and its subclasses. The main intention of this interface is to be able to plug in additional conversion for JDBC 4.2 with the jsr310 classes that are not available in Java 7 and earlier, without having to do a lot of work in 'subclasses per version'.

Author(s):
Mark Rotteveel
Since:
2.2
interface ObjectConverter {

    
If the object type is supported, and the object (or its conversion) is allowed by JDBC, it sets the field with the (converted) object.

As this method is - for the time being - intended as a workaround for JDBC 4.2, it specifically only supports new conversions in JDBC 4.2. It will return false for any other object type.

Parameters:
field FBField implementation to set
object The object value to set
Returns:
true when a conversion was applied, false when there is no conversion for the object and field
Throws:
java.sql.SQLException For exceptions when setting the object on the field (eg unsupported conversion).
    boolean setObject(FBField fieldObject objectthrows java.sql.SQLException;
New to GrepCode? Check out our FAQ X