Java Code Examples for javax.sql.RowSet#setCommand()

The following examples show how to use javax.sql.RowSet#setCommand() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JdbcRowSetAccessor.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
public RowSet createRowSet(JdbcRowSetSource ds) {
    try {
        RowSet rowSet = ds.createRowSet();
        
        // Set the maximum rows to be retrieved
        int maxRows = ds.getMaxRows();
        rowSet.setMaxRows(maxRows);
        
        // Get the query and apply it to the row set
        String query = getQuery();
        rowSet.setCommand(query);
        
        // Set the request parameters if any
        if(parameters!=null) {
            for(int i=0; i<parameters.size(); i++) {
                Object p = parameters.get(i);
                rowSet.setObject(i+1, p);
            }
        }
        
        // Then execute the query
        // Cast to CachedRoowSet until we get JNDI on
        //rowSet.execute();
        getCachedRowSet(rowSet).execute(findConnection());

        return rowSet;
    } catch(Exception ex) {
        // "Error while reading the relational data"
        String msg = com.ibm.xsp.extlib.relational.RelationalResourceHandler.getSpecialAudienceString(
                "JdbcDataBlockAccessor.Errorwhilereadingtherelationaldat"); //$NON-NLS-1$ 
        throw new FacesExceptionEx(ex,msg);
    }
}
 
Example 2
Source File: CommonRowSetTests.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}
 
Example 3
Source File: CommonRowSetTests.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}
 
Example 4
Source File: CommonRowSetTests.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}
 
Example 5
Source File: CommonRowSetTests.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}
 
Example 6
Source File: CommonRowSetTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}
 
Example 7
Source File: CommonRowSetTests.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}
 
Example 8
Source File: CommonRowSetTests.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}
 
Example 9
Source File: CommonRowSetTests.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}
 
Example 10
Source File: CommonRowSetTests.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(dataProvider = "rowSetType")
public void commonRowSetTest0001(RowSet rs) throws Exception {
    rs.setCommand(query);
    assertTrue(rs.getCommand().equals(query));
}