diff --git a/src/osm/jp/coverage/fuel/ToPostgis.java b/src/osm/jp/coverage/fuel/ToPostgis.java index 51fd4e0..047601a 100644 --- a/src/osm/jp/coverage/fuel/ToPostgis.java +++ b/src/osm/jp/coverage/fuel/ToPostgis.java @@ -60,16 +60,16 @@ * @throws org.xml.sax.SAXException */ public static void transport (Connection conHsql, Connection conPost) throws FileNotFoundException, ClassNotFoundException, SQLException, IOException, ParserConfigurationException, SAXException { - try (PreparedStatement ps1 = conHsql.prepareStatement("SELECT idref,area,fixed,lat,lon FROM FUEL where up=2")) { + try (PreparedStatement ps1 = conHsql.prepareStatement("SELECT idref,area,fixed1,lat,lon FROM FUEL where up=2")) { try (ResultSet rset1 = ps1.executeQuery()) { while (rset1.next()) { String idref = rset1.getString("idref"); int area = rset1.getInt("area"); - int fixed = rset1.getInt("fixed"); + int fixed1 = rset1.getInt("fixed1"); double lat = rset1.getDouble("lat"); double lon = rset1.getDouble("lon"); - String sqlStr = "INSERT INTO t_FUEL (idref,fixed,area,geom) VALUES ('"+ idref +"',"+ fixed +","+ area +",ST_GeomFromText('POINT("+ BigDecimal.valueOf(lon).toPlainString() +" "+ BigDecimal.valueOf(lat).toPlainString() +")', 4612))"; + String sqlStr = "INSERT INTO t_FUEL (idref,fixed,area,geom) VALUES ('"+ idref +"',"+ fixed1 +","+ area +",ST_GeomFromText('POINT("+ BigDecimal.valueOf(lon).toPlainString() +" "+ BigDecimal.valueOf(lat).toPlainString() +")', 4612))"; try (PreparedStatement ps = conPost.prepareStatement(sqlStr)) { System.out.println(sqlStr); ps.executeUpdate(); @@ -78,15 +78,15 @@ } } - try ( PreparedStatement ps1 = conHsql.prepareStatement("SELECT gid,fixed FROM FUEL where up=1"); + try ( PreparedStatement ps1 = conHsql.prepareStatement("SELECT gid,fixed1 FROM FUEL where up=1"); PreparedStatement ps2 = conPost.prepareStatement("UPDATE t_FUEL set fixed=? WHERE gid=?")) { try (ResultSet rset1 = ps1.executeQuery()) { while (rset1.next()) { long gid = rset1.getLong("gid"); - int fixed = rset1.getInt("fixed"); - ps2.setInt(1, fixed); + int fixed1 = rset1.getInt("fixed1"); + ps2.setInt(1, fixed1); ps2.setLong(2, gid); - System.out.println("UPDATE t_FUEL set fixed="+ fixed +" WHERE gid="+ gid); + System.out.println("UPDATE t_FUEL set fixed="+ fixed1 +" WHERE gid="+ gid); ps2.executeUpdate(); } }