Kbase P132406: Is there any sample code which implements a Java InputResultSet class?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  17/05/2011 |
|
Status: Verified
GOAL:
Is there any sample code which implements a Java InputResultSet class?
GOAL:
What should the code for my Java InputResultSet class look like?
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.x
FIX:
The following Java code gives you a shell for a working InputResultSet class. You will need to modify it to implement some sort of record storage mechanism along with, at a minimum, the next() and getObject() methods. You may want to implement the beforeFirst() method also as doing so would allow you to walk through the data in your code and then reset the record pointer so that all records would be sent to the AppServer when you pass the InputResultSet to the AppServer.
Please remember that when passing an InputResultSet to the AppServer we pass only those records that are after the current record position. This means that if you do not implement the beforeFirst() method and use it prior to calling the AppServer you may not get the data that you expect.
import java.util.Vector;
import com.progress.open4gl.InputResultSet;
public class RSTable extends InputResultSet
{
private Vector rows;
private int rowNum;
private Vector currentRow;
RSTable ()
{
// do whatever you need to do here
}
public void beforeFirst()
{
// do whatever you need to do here to reset your
// internal record pointer before the first record
}
public boolean next()
{
// do whatever you need to do here to move to the
// next record then return true/false to tell the
// caller whether there is a record available
}
public Object getObject(int pos)
{
// do whatever you need to do here to return
// the data for a given field position
}
// all of the following methods are required by the latest
// versions of Java. Modify as required to suit your needs.
public void updateNClob(String x, java.io.Reader y)
{
}
public void updateNClob(String x, java.io.Reader y, long z)
{
}
public void updateNClob(java.io.Reader y)
{
}
public void updateNClob(int x, java.io.Reader y)
{
}
public void updateNClob(int x, java.io.Reader y, long z)
{
}
public void updateClob(String x, java.io.Reader y)
{
}
public void updateClob(String x, java.io.Reader y, long z)
{
}
public void updateClob(java.io.Reader y)
{
}
public void updateClob(int x, java.io.Reader y)
{
}
public void updateClob(int x, java.io.Reader y, long z)
{
}
public void updateBlob(String x, java.io.InputStream y)
{
}
public void updateBlob(String x, java.io.InputStream y, long z)
{
}
.public void updateBlob(java.io.InputStream y)
{
}
public void updateBlob(int x, java.io.InputStream y)
{
}
public void updateBlob(int x, java.io.InputStream y, long z)
{
}
public void updateCharacterStream(String x, java.io.Reader y)
{
}
public void updateCharacterStream(String x, java.io.Reader y, long z)
{
}
public void updateCharacterStream(java.io.Reader y)
{
}
public void updateCharacterStream(int x, java.io.Reader y)
{
}
public void updateCharacterStream(int x, java.io.Reader y, long z)
{
}
public void updateBinaryStream(String x, java.io.InputStream y)
{
}
public void updateBinaryStream(String x, java.io.InputStream y, long z)
{
}
public void updateBinaryStream(java.io.InputStream y)
{
}
public void updateBinaryStream(int x, java.io.InputStream y)
{
}
public void updateBinaryStream(int x, java.io.InputStream y, long z)
{
}
public void updateAsciiStream(String x, java.io.InputStream y)
{
}
public void updateAsciiStream(String x, java.io.InputStream y, long z)
{
}
public void updateAsciiStream(java.io.InputStream y)
{
}
public void updateAsciiStream(int x, java.io.InputStream y)
{
}
public void updateAsciiStream(int x, java.io.InputStream y, long z)
{
}
public void updateNCharacterStream(String x, java.io.Reader y)
{
}
public void updateNCharacterStream(String x, java.io.Reader y, long z)
{
}
public void updateNCharacterStream(java.io.Reader y)
{
}
public void updateNCharacterStream(int x, java.io.Reader y)
{
}
public void updateNCharacterStream(int x, java.io.Reader y, long z)
{
}
public java.io.Reader getNCharacterStream(String x)
{
return null;
}
public java.io.Reader getNCharacterStream(int x)
{
return null;
}
public String getNString(String x)
{
return null;
}
public String getNString(int x)
{
return null;
}
public void updateSQLXML(String x, java.sql.SQLXML y)
{
}
public void updateSQL.XML(int x, java.sql.SQLXML y)
{
}
public java.sql.SQLXML getSQLXML(String x)
{
return null;
}
public java.sql.SQLXML getSQLXML(int x)
{
return null;
}
public java.sql.NClob getNClob(String x)
{
return null;
}
public java.sql.NClob getNClob(int x)
{
return null;
}
public void updateNClob(String x, java.sql.NClob y)
{
}
public void updateNClob(int x, java.sql.NClob y)
{
}
public void updateNString(String x, String y)
{
}
public void updateNString(int x, String y)
{
}
public boolean isClosed()
{
return false;
}
public int getHoldability()
{
return 1;
}
public void updateRowId(String x, java.sql.RowId y)
{
}
public void updateRowId(int x, java.sql.RowId y)
{
}
public void updateRowId(java.sql.RowId y)
{
}
public java.sql.RowId getRowId(String x)
{
return null;
}
public java.sql.RowId getRowId(int x)
{
return null;
}
public boolean isWrapperFor(java.lang.Class<?> x)
{
return false;
}
public <T> T unwrap(java.lang.Class<T> x)
{
return null;
}
}
.