Package oracle.sql

Examples of oracle.sql.OPAQUE


*/

public class OracleSqlXmlTypeTest {

    private static void test(Connection con) throws Exception {
        OPAQUE opaque = getOpaque(con);
        readOpaqueAsBytes(opaque);
        opaque = getOpaque(con);
        readOpaqueAsCharacterStream(opaque);
        opaque = getOpaque(con);
        readOpaqueAsJdbc(opaque);
View Full Code Here


        readObjectUsingXmlType(opaque);
        setNullXmlValue(con);
    }
   
    private static OPAQUE getOpaque(Connection con) throws Exception{
        OPAQUE result = null;
        ResultSet rs = null;
        Statement stmt = null;
        try {
            stmt = con.createStatement();
            //System.out.println("Selecting xml_data");
View Full Code Here

    validateClasses();
   
    Object o = rst.getObject(columnIndex);
    if(o==null) return null;
   
    OPAQUE opaque = ((oracle.sql.OPAQUE)o);
    if(opaque.getSQLTypeName().equals("SYS.XMLTYPE")){
      return oracle.xdb.XMLType.createXML(opaque).getStringVal();
    }
    return o;
  }
View Full Code Here

    public Object getSqlValue(int column, ResultSet resultSet) throws SQLException, TypeCastException
    {
        byte[] data = new byte[0];
        OracleResultSet oracleResultSet = (OracleResultSet) resultSet;
        OPAQUE opaque = oracleResultSet.getOPAQUE(column);
        if (opaque != null)
        {
            data = opaque.getBytes();
        }

        // return the byte data (using typeCast to cast it to Base64 notation)
        return typeCast(data);
    }
View Full Code Here

    public void setSqlValue(Object value, int column, PreparedStatement statement) throws SQLException, TypeCastException
    {
        OraclePreparedStatement oraclePreparedStatement = (OraclePreparedStatement) statement;
        OpaqueDescriptor opaqueDescriptor = OpaqueDescriptor.createDescriptor("SYS.XMLTYPE", statement.getConnection());
        OPAQUE opaque = new OPAQUE(opaqueDescriptor, (byte[]) typeCast(value), statement.getConnection());
        oraclePreparedStatement.setOPAQUE(column, opaque);
    }
View Full Code Here

TOP

Related Classes of oracle.sql.OPAQUE

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.