Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

showing how to get full object with getObject(0)

  • Loading branch information...
commit 5e57085f196d1a2ed6e1e75522a7a770bca8d8ef 1 parent ed75e67
@erh authored
View
2  examples/first.java
@@ -8,7 +8,7 @@ static void print( String name , ResultSet res )
throws SQLException {
System.out.println( name );
while ( res.next() ){
- System.out.println( "\t" + res.getString( "name" ) + "\t" + res.getInt( "age" ) );
+ System.out.println( "\t" + res.getString( "name" ) + "\t" + res.getInt( "age" ) + "\t" + res.getObject(0) );
}
}
View
4 src/main/com/mongodb/jdbc/MongoResultSet.java
@@ -464,9 +464,13 @@ Number _getNumber( String n ){
public Object getObject(int columnIndex){
+ if ( columnIndex == 0 )
+ return _cur;
return getObject( _find( columnIndex ) );
}
public Object getObject(int i, Map map){
+ if ( i == 0 )
+ return _cur;
return getObject( _find( i ) , map );
}
public Object getObject(String columnName){
Please sign in to comment.
Something went wrong with that request. Please try again.