//Datenbank wird hier rausgelesen
rset = stmt.executeQuery("SELECT LAST_NAME,FIRST_NAME, DEPARTMENT_ID, MANAGER_ID FROM employees" +
"WHERE DEPARTMENT_ID = 50 " +
"AND MANAGER_ID = 120");
// declare constants for column indexes in the query
// Die fallen jetzt raus......
//final int EMPLOYEE_COLUMN_INDEX = 1;
//final int LAST_COLUMN_INDEX = 2;
//final int FIRST_COLUMN_INDEX = 3;
//final int EMAIL_COLUMN_INDEX = 4;
//final int PHONE_COLUMN_INDEX = 5;
//final int DEP_COLUMN_INDEX = 6;
//final int JOB_COLUMN_INDEX = 7;
//final int MANAGER_COLUMN_INDEX = 8;
// Hier die Spatenabfrage...
ResultSetMetaData rsmd = rset.getMetaData();
int numberOfColumns = rsmd.getColumnCount();
//print the results
while (rset.next())
{
for (int i=1; i <= numberOfColumns;i++)
{
try
{
System.out.println(rsmd.getColumnName(i)+" "+ rset.getString(i));
}
catch (Exception ex)
{
System.out.println(ex);
}
}
}
catch (SQLException e)
{
// handle the exception properly - in this case, we just
// print a message and