/** * {@inheritDoc} */ @Override public int getColumnType(int column) throws SQLException { return Converters.getJdbcType(getDescriptor(column).type); }
private void registerOutputParameters(CallableStatement cstmt, Map<Integer, OutputParameter> outputParams) throws SQLException { if (outputParams != null && !outputParams.isEmpty()) { OutputParameter outParam; int jdbcType; for (Map.Entry<Integer, OutputParameter> param : outputParams .entrySet()) { outParam = param.getValue(); jdbcType = Converters.getJdbcType(outParam.type); int paramPosition = param.getKey(); if (outParam.isSetScale()) { cstmt.registerOutParameter(paramPosition, jdbcType, outParam.scale); } else if (outParam.isSetTypeName()) { cstmt.registerOutParameter(paramPosition, jdbcType, outParam.typeName); } else { cstmt.registerOutParameter(paramPosition, jdbcType); } } } }
/** * {@inheritDoc} */ @Override public int getParameterType(int param) throws SQLException { return Converters.getJdbcType(getDescriptor(param).getType()); }
/** * {@inheritDoc} */ @Override public RowSet getUDTs(ServiceMetaDataArgs args, List<SnappyType> types) throws SnappyException { ResultSet rs = null; try { final ConnectionHolder connHolder = getValidConnection(args.connId, args.token); EmbedDatabaseMetaData dmd = (EmbedDatabaseMetaData)connHolder .getConnection().getMetaData(); int[] sqlTypes = null; if (types != null && !types.isEmpty()) { sqlTypes = new int[types.size()]; for (int index = 0; index < types.size(); index++) { sqlTypes[index] = Converters.getJdbcType(types.get(index)); } } rs = dmd.getUDTs(null, args.getSchema(), args.getTypeName(), sqlTypes); return getRowSet(null, null, rs, INVALID_ID, null, args.connId, null, 0, false, false, 0, connHolder, "getUDTs"); } catch (Throwable t) { cleanupResultSet(rs); checkSystemFailure(t); throw SnappyException(t); } }
pstmt.setString(paramPosition, (String)params.getObject(index)); } else { pstmt.setNull(paramPosition, Converters.getJdbcType( SnappyType.findByValue(paramType))); pstmt.setBytes(paramPosition, (byte[])params.getObject(index)); } else { pstmt.setNull(paramPosition, Converters.getJdbcType( SnappyType.findByValue(paramType)));
Util.typeName(Converters.getJdbcType(colType)));
if (isODBC) { rs = dmd.getTypeInfoForODBC((short)(args.isSetTypeId() ? Converters .getJdbcType(args.getTypeId()) : 0)); } else { rs = dmd.getTypeInfo();