they were not necessary; if an application wanted to get data in this manner, then the application could provide a routine to cross reference the column name to a column number. Unfortunately (in my opinion), JavaSoft chose to keep these methods in the API and provide the implementation of the cross reference method in an appendix. Because it is part of the API, all drivers must implement the methods. Implementing the methods is not all that difficult, but it is tedious and adds overhead to the driver. The driver simply takes the column name that is given, gets the corresponding column number for the column name, and invokes the same get method using the column number: public String getString( String columnName) throws SQLException { return getString(findColumn(columnName)); } And here s the findColumn routine: public int findColumn( String columnName) throws SQLException { // Make a mapping cache if we don’t already have one if (md == null) { md = getMetaData(); s2c = new Hashtable(); } // Look for the mapping in our cache Integer x = (Integer) s2c.get(columnName); if (x != null) { return (x.intValue()); } // OK, we’ll have to use metadata for (int i = 1; i < md.getColumnCount(); i++) { if (md.getColumnName(i).equalsIgnoreCase(columnName)) { // Success! Add an entry to the cache s2c.put(columnName, new Integer(i)); return (i); } } throw new SQLException("Column name not found: " + columnName, "S0022"); } This method uses a Hashtable to cache the column number and column names. It s Your Way, Right Away An application can request column data in any one of the supported JDBC data types. As we have discussed before, the driver should coerce the data into the proper format. The SimpleText driver accomplishes this by using a CommonValue object for all data values. Therefore, the data can be served in any format, stored as a CommonValue
Have you tried other web hosting companies and found out that their focus and your focus are in clash?Check our filemaker web hosting services.

Leave a Reply