Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java app shows segmented results vs Access

807600Oct 29 2007 — edited Oct 29 2007
Hello again all,
This time i hope i'm asking a less stupid question

when i run the following query in access,i get the correct results
i didn't put it in code brackets, cause you'll have to scrool a lot to the left :p

SELECT AB_Qr_History_With_CurrentRel.ID, AB_Qr_History_With_CurrentRel.Project, AB_Qr_History_With_CurrentRel.HistoryRelCode, AB_Qr_History_With_CurrentRel.Title, AB_Qr_History_With_CurrentRel.TypeShort, Round(Sum([TotMD_Augeo]-[T14a_HistoryT12b]![TotMD_Previous]),2) AS Delta_Md, Round(Sum(T14a_HistoryT12b.TotMD_Previous),2) AS SumOfTotMD_Previous, Round(Sum(T14a_HistoryT12b.TotMD_Report),2) AS SumOfTotMD_Report, Round(Sum(T14a_HistoryT12b.TotMD_ToBeConf),2) AS SumOfTotMD_ToBeConf, Round(Sum(T14a_HistoryT12b.TotMD_AMPM),2) AS SumOfTotMD_AMPM, Round(Sum(T14a_HistoryT12b.TotMD_NotJust),2) AS SumOfTotMD_NotJust, AB_Qr_History_With_CurrentRel.AppPrjMan FROM AB_Qr_History_With_CurrentRel GROUP BY AB_Qr_History_With_CurrentRel.ID, AB_Qr_History_With_CurrentRel.Project, AB_Qr_History_With_CurrentRel.HistoryRelCode, AB_Qr_History_With_CurrentRel.Title, AB_Qr_History_With_CurrentRel.TypeShort, AB_Qr_History_With_CurrentRel.AppPrjMan HAVING (((AB_Qr_History_With_CurrentRel.AppPrjMan) ='De Koning Peter')) ORDER BY AB_Qr_History_With_CurrentRel.Project, AB_Qr_History_With_CurrentRel.HistoryRelCode


Now,
when i use this query in my java application ,i get no errors what so ever, but it only shows the first row in the jtable.
( i'm assuming my code is correct,since i don't get errors with other queries")

Just in case, here is my perfectly normal class that fills the table:

{code}
public Object[][] fetch_data(String tabel,ResultSet rs)
{

R = 0;

try {
rs.last();
} catch ( SQLException e1 ) {

// e1.printStackTrace();
}
try {
aRow = rs.getRow();
} catch ( SQLException e1 ) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
rs.beforeFirst();
} catch ( SQLException e1 ) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

ResultSetMetaData RSMD = null;
try {
RSMD = rs.getMetaData();
} catch ( SQLException e ) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
column_count =RSMD.getColumnCount();
} catch ( SQLException e ) {
// TODO Auto-generated catch block
e.printStackTrace();

}


String[] column_names = new String[column_count];
column_headers = column_names;
myArray = new Object[aRow][column_count];

for(int i=0;i<column_count;i++){
try {
column_names=RSMD.getColumnName(i+1);
} catch ( SQLException e ) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

try {
while(rs.next()) {
for(int C=1; C<=column_count;C++){
myArray[R][C-1]=rs.getObject(C);
}
R++;
}

} catch ( SQLException e ) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return myArray;
}
{code}

thx for any input
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2007
Added on Oct 29 2007
9 comments
80 views