Hi,
I am trying to clone a Visual FoxPro database into a PostgreSQL database. However when I use the DatabaseMetadata from the HXTT JDBC driver the column names are truncated at 10 characters. How can I get the full column name? Here is a snippet of code:
String url = "jdbc:dbf:/c:/pathToDBC/";
Properties properties = new Properties();
properties.setProperty("lockType", "VFP");
properties.setProperty("versionNumber", "30");
properties.setProperty("OtherExtensions", "true");
properties.setProperty("MissingMemoFile", "ignore");
properties.setProperty("loadIndices", "false");
properties.setProperty("Default Index Suffix", "cdx");
cn = DriverManager.getConnection(url, properties);
metadata = cn.getMetaData();
String catalog = cn.getCatalog();
ResultSet rs = metadata.getColumns(catalog, null, tableName, null);
const int COLUMN_NAME = 4;
while (rs.next())
{
log.debug(rs.getString(COLUMN_NAME).toLowerCase());
}
For example: With a table containing a column called TOTEXTENDED I get a column name of TOTEXTENDE with this code.
|
The dbf database limit the column name to maxiumn 10 characters.
So it will truncate the column name to 10 characters.
|