Java Reference
In-Depth Information
System.out.printf("%.2f %n%n",
results.getFloat(i));
break;
default: System.out.println("Unknown");
}
}
//End of step 4.
//(No further queries, so no Step 5!)
//Step 6…
connection.close();
}
catch(SQLException ex)
{
System.out.println(
"* SQL or connection error! *");
ex.printStackTrace();
System.exit(1);
}
}
}
The output from this program is shown in Fig. 7.3 . The only features of note
concern the balance fi eld. The MS Access-specifi c type for this fi eld is CURRENCY ,
its SQL type is represented in Java by the integer constant NUMERIC and the value
in this fi eld has to be retrieved via method getFloat !
Fig. 7.3 Output from program JDBCMetaData
Search WWH ::




Custom Search