Package java.sql

Examples of java.sql.ResultSet.findColumn()


        assertEquals(2, rs.findColumn("Name"));
        assertEquals(3, rs.findColumn("Data"));
        assertEquals(1, rs.findColumn("TEST.ID"));
        assertEquals(2, rs.findColumn("TEST.NAME"));
        assertEquals(3, rs.findColumn("TEST.DATA"));
        assertEquals(1, rs.findColumn("Test.Id"));
        assertEquals(2, rs.findColumn("Test.Name"));
        assertEquals(3, rs.findColumn("Test.Data"));
        stat.execute("DROP TABLE TEST");

    }
View Full Code Here


        assertEquals(3, rs.findColumn("Data"));
        assertEquals(1, rs.findColumn("TEST.ID"));
        assertEquals(2, rs.findColumn("TEST.NAME"));
        assertEquals(3, rs.findColumn("TEST.DATA"));
        assertEquals(1, rs.findColumn("Test.Id"));
        assertEquals(2, rs.findColumn("Test.Name"));
        assertEquals(3, rs.findColumn("Test.Data"));
        stat.execute("DROP TABLE TEST");

    }
View Full Code Here

        assertEquals(1, rs.findColumn("TEST.ID"));
        assertEquals(2, rs.findColumn("TEST.NAME"));
        assertEquals(3, rs.findColumn("TEST.DATA"));
        assertEquals(1, rs.findColumn("Test.Id"));
        assertEquals(2, rs.findColumn("Test.Name"));
        assertEquals(3, rs.findColumn("Test.Data"));
        stat.execute("DROP TABLE TEST");

    }

    private void testColumnLength() throws SQLException {
View Full Code Here

        // check(rs.findColumn("T.NAME"), 2);

        rs = stat.executeQuery("SELECT *, NULL AS N FROM TEST ORDER BY ID");

        // MySQL compatibility
        assertEquals(1, rs.findColumn("TEST.ID"));
        assertEquals(2, rs.findColumn("TEST.VALUE"));

        ResultSetMetaData meta = rs.getMetaData();
        assertEquals(3, meta.getColumnCount());
        assertEquals("resultSet".toUpperCase(), meta.getCatalogName(1));
View Full Code Here

        rs = stat.executeQuery("SELECT *, NULL AS N FROM TEST ORDER BY ID");

        // MySQL compatibility
        assertEquals(1, rs.findColumn("TEST.ID"));
        assertEquals(2, rs.findColumn("TEST.VALUE"));

        ResultSetMetaData meta = rs.getMetaData();
        assertEquals(3, meta.getColumnCount());
        assertEquals("resultSet".toUpperCase(), meta.getCatalogName(1));
        assertTrue("PUBLIC".equals(meta.getSchemaName(2)));
View Full Code Here

   
    @Test public void testFindNonExistentColumn() throws SQLException {
        ResultSet rs = helpExecuteQuery();
        rs.next();
        try {
            rs.findColumn("BOGUS"); //$NON-NLS-1$
        } catch(SQLException e) {
        }
       
        try {
            rs.getObject("BOGUS"); //$NON-NLS-1$
View Full Code Here

        iCols = 0;

      while (oReadRSet.next()) {

        for (int c=1; c<=iCols; c++) {
          iColPos = oReadRSet.findColumn(oUpdtStmt.columns[c-1]);
          iOriginType = oReadMDat.getColumnType(iColPos);
          iTargetType = oTargetDef.ColTypes[oTargetDef.findColumnPosition(oUpdtStmt.columns[c-1])];

          oUpdtStmt.sqlstatement.setObject (c, cast(oReadRSet.getObject(iColPos), iOriginType, iTargetType), iTargetType);
        }
View Full Code Here

        iUpdtCols = 0;

      while (oReadRSet.next()) {

        for (int c=1; c<=iUpdtCols; c++) {
          iColPos = oReadRSet.findColumn(oUpdtStmt.columns[c-1]);
          iOriginType = oReadMDat.getColumnType(iColPos);
          iTargetType = oTargetDef.ColTypes[oTargetDef.findColumnPosition(oUpdtStmt.columns[c-1])];

          //if (DebugFile.trace) DebugFile.writeln("UpdateStatement.setObject (" + String.valueOf(c) + "," + cast(oReadRSet.getObject(iColPos), iOriginType, iTargetType) + "," + iTargetType + ")");
View Full Code Here

        }

        if (0==iUpdated) {
          for (int c=1; c<=iInsrtCols; c++) {

            iColPos = oReadRSet.findColumn(oInsrtStmt.columns[c-1]);
            iOriginType = oReadMDat.getColumnType(iColPos);
            iTargetType = oTargetDef.ColTypes[oTargetDef.findColumnPosition(oInsrtStmt.columns[c-1])];

            //if (DebugFile.trace) DebugFile.writeln("InsertStatement.setObject (" + String.valueOf(c) + "," + cast(oReadRSet.getObject(iColPos), iOriginType, iTargetType) + "," + iTargetType + ")");
View Full Code Here

    oStmt.setTimestamp(1, new Timestamp(new Date().getTime()));

    oRSet = oStmt.executeQuery();

    oMDat = oRSet.getMetaData();
    iJobCol = oRSet.findColumn(DB.gu_job);
    iAtmCol = oRSet.findColumn(DB.pg_atom);

    // Bucle de carga y actualización de estado de job_atoms

    sSQL = "UPDATE " + DB.k_job_atoms + " SET " + DB.id_status + "=" + Atom.STATUS_RUNNING + " WHERE " + DB.gu_job + "=? AND " + DB.pg_atom + "=?";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.