Package java.sql

Examples of java.sql.Array


            statement.execute(ddl0);
            statement.execute(ddl1);
            statement.execute(dml1);
            PreparedStatement ps = connection.prepareStatement(dml2);
            Object[] objects = new Object [] { "1", 3, 9};
            Array array = connection.createArrayOf("INTEGER", objects);
            ps.setArray(1, array);
            ps.execute();

        } catch (SQLException e) {
            e.printStackTrace();
View Full Code Here


   * @see java.sql.CallableStatement#getArray(int)
   */
  public synchronized Array getArray(int i) throws SQLException {
    ResultSetInternalMethods rs = getOutputParameters(i);

    Array retValue = rs.getArray(mapOutputParameterIndexToRsIndex(i));

    this.outputParamWasNull = rs.wasNull();

    return retValue;
  }
View Full Code Here

  public synchronized Array getArray(String parameterName)
      throws SQLException {
    ResultSetInternalMethods rs = getOutputParameters(0); // definitely not going to be
    // from ?=

    Array retValue = rs.getArray(fixParameterName(parameterName));

    this.outputParamWasNull = rs.wasNull();

    return retValue;
  }
View Full Code Here

    }

    public void testSetArray() throws SQLException {
        BaseRowSetImpl brs = new BaseRowSetImpl();
        brs.initParams();
        Array a = new MockArray();
        brs.setArray(1, a);
        Object[] params = brs.getParams();
        assertNotNull(params);
        assertEquals(1, params.length);
        assertTrue("Should have stored a SerialArray",
View Full Code Here

    public void testGetNamesWithArray() throws SQLException {
        SqlSession sqlSession = sqlSessionFactory.openSession();
        try {
            SPMapper spMapper = sqlSession.getMapper(SPMapper.class);
           
            Array array = sqlSession.getConnection().createArrayOf("int",
                    new Integer[] {1, 2, 5});
           
            Map<String, Object> parms = new HashMap<String, Object>();
            parms.put("ids", array);
            List<Name> names = spMapper.getNamesWithArray(parms);
View Full Code Here

    public void testGetNamesWithArray_a1() throws SQLException {
        SqlSession sqlSession = sqlSessionFactory.openSession();
        try {
            SPMapper spMapper = sqlSession.getMapper(SPMapper.class);
           
            Array array = sqlSession.getConnection().createArrayOf("int",
                    new Integer[] {1, 2, 5});
           
            Map<String, Object> parms = new HashMap<String, Object>();
            parms.put("ids", array);
            List<Name> names = spMapper.getNamesWithArrayAnnotated(parms);
View Full Code Here

    public void testGetNamesWithArray_a2() throws SQLException {
        SqlSession sqlSession = sqlSessionFactory.openSession();
        try {
            SPMapper spMapper = sqlSession.getMapper(SPMapper.class);
           
            Array array = sqlSession.getConnection().createArrayOf("int",
                    new Integer[] {1, 2, 5});
           
            Map<String, Object> parms = new HashMap<String, Object>();
            parms.put("ids", array);
            List<Name> names = spMapper.getNamesWithArrayAnnotatedWithXMLResultMap(parms);
View Full Code Here

        ps.setArray(i, (Array) parameter);
    }

    public Object getResult(ResultSet rs, String columnName)
            throws SQLException {
        Array array = rs.getArray(columnName);
        return array.getArray();
    }
View Full Code Here

        return array.getArray();
    }

    public Object getResult(CallableStatement cs, int columnIndex)
            throws SQLException {
        Array array = cs.getArray(columnIndex);
        return array.getArray();
    }
View Full Code Here

        return value;
    }

    @Override
    public Array getArray(int parameterIndex) throws SQLException {
        Array value = outParameters().getValue(translate(parameterIndex), Array.class);
        resultWasNull = value == null;
        return value;
    }
View Full Code Here

TOP

Related Classes of java.sql.Array

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.