1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| ResultSet n = connect.createStatement().executeQuery("SELECT * FROM PERSONNE");
CachedRowSet unJoinable = new CachedRowSetImpl();
unJoinable.populate(n);
ResultSet v = c.createStatement().executeQuery("SELECT * FROM PERSONNE");
CachedRowSet unAutreJoinable = new CachedRowSetImpl();
unAutreJoinable.populate(v);
JoinRowSet join = new JoinRowSetImpl();
join.addRowSet(unJoinable,1);
join.addRowSet(unAutreJoinable,1);
join.setJoinType(JoinRowSet.LEFT_OUTER_JOIN);
while(join.next()){
for(int i=0; i<join.getMetaData().getColumnCount();i++){
System.out.print(join.getObject(i+1)+" ");
}
System.out.print("\n"); |