我使用这个XML文档将特定的表加载到postgresql数据库中:
create_table.xml:
<?xml version="1.0"?>
<!DOCTYPE database SYSTEM "http://db.apache.org/torque/dtd/database.dtd">
<database name="sample">
<table name="Location">
<column name="LocationID" type="INTEGER" primaryKey="true" />
<column name="LocationModifyDate" type="DATETIME" required="true" />
</table>
</database>但是当我加载它时,我得到了一个例外:
An exception occurred. Please see the following for details:
-------------------------------------------------------------------------------
org.jumpmind.db.model.ModelException: Unknown JDBC type DATETIME
at org.jumpmind.db.model.Column.setMappedType(Column.java:283)
at org.jumpmind.db.io.DatabaseXmlUtil.nextTable(DatabaseXmlUtil.java:202)
at org.jumpmind.symmetric.io.data.reader.XmlDataReader.readNext(XmlDataReader.java:139)
at org.jumpmind.symmetric.io.data.reader.XmlDataReader.open(XmlDataReader.java:75)
at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:84)
at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:78)
at org.jumpmind.symmetric.io.data.DbImport.importTablesFromXml(DbImport.java:208)
at org.jumpmind.symmetric.io.data.DbImport.importTables(DbImport.java:154)
at org.jumpmind.symmetric.DbImportCommand.executeWithOptions(DbImportCommand.java:188)
at org.jumpmind.symmetric.AbstractCommandLauncher.execute(AbstractCommandLauncher.java:130)
at org.jumpmind.symmetric.DbImportCommand.main(DbImportCommand.java:72)用于加载XML文件的命令如下:
../bin/dbimport --engine corp-000 -format XML create_table.xml如果使用整数而不是日期时间,则将正确处理XML文件并创建表。
这一例外意味着什么?也许我必须使用JDBC标准数据类型?
发布于 2013-08-17 21:13:04
使用时间戳而不是日期时间
<column name="LocationModifyDate" type="TIMESTAMP" required="true" />请阅读postgresql中的日期/时间手册:
http://www.postgresql.org/docs/9.1/static/datatype-datetime.html
https://stackoverflow.com/questions/18293366
复制相似问题