version 1.10, 2004/03/12 11:48:57
|
version 1.14, 2004/04/08 09:48:47
|
Line 1
|
Line 1
|
|
/* |
|
* DBBean.java -- Class that ecapsulates all database actions |
|
* Filemake to SQL Converter |
|
* Copyright (C) 2004 Robert Gordesch (rogo@mpiwg-berlin.mpg.de) |
|
* This program is free software; you can redistribute it and/or modify it |
|
* under the terms of the GNU General Public License as published by the Free |
|
* Software Foundation; either version 2 of the License, or (at your option) |
|
* any later version. Please read license.txt for the full details. A copy of |
|
* the GPL may be found at http://www.gnu.org/copyleft/lgpl.html You should |
|
* have received a copy of the GNU General Public License along with this |
|
* program; if not, write to the Free Software Foundation, Inc., 59 Temple |
|
* Place, Suite 330, Boston, MA 02111-1307 USA Created on 15.09.2003 by |
|
* rogo |
|
*/ |
|
|
|
|
import java.sql.*; |
import java.sql.*; |
Line 555 public class DBBean
|
Line 569 public class DBBean
|
// container fields |
// container fields |
try |
try |
{ |
{ |
tableRow.addElement(new Integer(resultSet.getInt(i))); |
tableRow.addElement(new Double(resultSet.getDouble(i))); |
m_columnClasses.addElement(Integer.class); |
m_columnClasses.addElement(Double.class); |
|
|
} catch (Exception e) |
} catch (Exception e) |
{ |
{ |
Line 574 public class DBBean
|
Line 588 public class DBBean
|
if (number.length() > 0) |
if (number.length() > 0) |
{ |
{ |
tableRow.addElement(null); |
tableRow.addElement(null); |
m_columnClasses.addElement(Integer.class); |
m_columnClasses.addElement(Double.class); |
} else |
} else |
tableRow.addElement(null); |
tableRow.addElement(null); |
} |
} |
Line 651 public class DBBean
|
Line 665 public class DBBean
|
|
|
if (!connection.isClosed()) |
if (!connection.isClosed()) |
stm = connection.createStatement(); |
stm = connection.createStatement(); |
|
else { |
|
|
|
|
|
try |
|
{ |
|
connection = getConnection(); |
|
stm= connection.createStatement(); |
|
} catch (Exception e) |
|
{ |
|
// TODO Auto-generated catch block |
|
e.printStackTrace(); |
|
} |
|
} |
stm.setMaxRows(numberOfHits); |
stm.setMaxRows(numberOfHits); |
long time = System.currentTimeMillis(); |
long time = System.currentTimeMillis(); |
stm.execute(query); |
stm.execute(query); |
Line 1241 public class DBBean
|
Line 1268 public class DBBean
|
// from FileMaker Pro container fields; the ResultSet.getObject |
// from FileMaker Pro container fields; the ResultSet.getObject |
// method returns a java.awt.Image object for FileMaker Pro |
// method returns a java.awt.Image object for FileMaker Pro |
// container fields |
// container fields |
|
try |
|
{ |
tableRow.addElement(resultSet.getDate(i)); |
tableRow.addElement(resultSet.getDate(i)); |
|
|
|
} catch (Exception e) |
|
{ |
|
String date=resultSet.getString(i); |
|
tableRow.addElement(date); |
|
System.out.println(date); |
|
} |
// m_columnClasses.addElement(java.sql.Date.class); |
// m_columnClasses.addElement(java.sql.Date.class); |
} else if (metaData.getColumnTypeName(i) == "NUMBER") |
} else if (metaData.getColumnTypeName(i) == "NUMBER") |
{ |
{ |
Line 1252 public class DBBean
|
Line 1287 public class DBBean
|
// container fields |
// container fields |
try |
try |
{ |
{ |
tableRow.addElement(new Integer(resultSet.getInt(i))); |
tableRow.addElement(new Double(resultSet.getDouble(i))); |
// m_columnClasses.addElement(Integer.class); |
// m_columnClasses.addElement(Integer.class); |
|
|
} catch (Exception e) |
} catch (Exception e) |