version 1.27, 2004/07/09 10:26:38
|
version 1.31, 2004/08/09 11:36:18
|
Line 612 public class DBBean
|
Line 612 public class DBBean
|
// container fields |
// container fields |
try |
try |
{ |
{ |
tableRow.addElement(new Double(resultSet.getDouble(i))); |
Double value =new Double(resultSet.getDouble(i)); |
m_columnClasses.addElement(Double.class); |
|
|
|
|
// tableRow.addElement(new Double(resultSet.getDouble(i))); |
|
String tVal =value.toString(); |
|
tVal = tVal.substring(tVal.indexOf('.')+1); |
|
boolean checkMe = tVal.length()==1&&tVal.equals("0"); |
|
// System.out.println("check was"+checkMe+" "+tVal); |
|
if(checkMe) |
|
tableRow.addElement(new Integer(value.intValue())); |
|
else |
|
tableRow.addElement(value); |
|
|
} catch (Exception e) |
} catch (Exception e) |
{ |
{ |
Line 1518 public class DBBean
|
Line 1528 public class DBBean
|
ResultSet result = this.result; |
ResultSet result = this.result; |
String subQuery = query.substring(query.lastIndexOf(table) + table.length() + 1); |
String subQuery = query.substring(query.lastIndexOf(table) + table.length() + 1); |
System.out.println("subQuery " + subQuery); |
System.out.println("subQuery " + subQuery); |
makeQuery("select " + id + " from " + getQC() + table + getQC() + subQuery, numHits); |
makeQuery("select " + id + " from " + getQC() + table + getQC() + subQuery+"order by "+id, numHits); |
while (true) |
while (true) |
{ |
{ |
Vector vec = getNextRow(); |
Vector vec = getNextRow(); |
Line 1545 public class DBBean
|
Line 1555 public class DBBean
|
{ |
{ |
useNormanToUnicodeMapper = b; |
useNormanToUnicodeMapper = b; |
} |
} |
|
/** |
|
* |
|
*/ |
|
protected void closeAllConnections() |
|
{ |
|
Enumeration enumeration = connectionPool.elements(); |
|
while(enumeration.hasMoreElements()) |
|
{ |
|
ConnectionPool conPol =(ConnectionPool)enumeration.nextElement(); |
|
try |
|
{ |
|
System.out.println(conPol); |
|
conPol.con.close(); |
|
} catch (SQLException e) |
|
{ |
|
// TODO Auto-generated catch block |
|
e.printStackTrace(); |
|
} |
|
} |
|
|
|
} |
|
/** |
|
* @param indexField |
|
*/ |
|
public String getColumnType(String indexField) throws SQLException |
|
{ |
|
Vector names=getColumnNames(); |
|
for (int i = 0; i < names.size(); i++) |
|
{ |
|
if(names.get(i).toString().equals(indexField)) |
|
{ |
|
System .out.println("found field "+names.get(i)+" "+metaData.getColumnTypeName(i+1)); |
|
return metaData.getColumnTypeName(i+1); |
|
|
|
} |
|
} |
|
return ""; |
|
} |
|
|
} |
} |
|
|