当我将数据放到MSAccess上时,它会带有美元符号。这是我的相关代码:
try (Connection conn = DriverManager.getConnection(
"jdbc:ucanaccess://" + dbPath
+ ";newdatabaseversion=V2010"
)) {
DatabaseMetaData dmd = conn.getMetaData();
try (ResultSet rs = dmd.getTables(null, null, tableName, new String[] { "TABLE" })) {
try (Statement s = conn.createStatement()) {
s.executeUpdate("CREATE TABLE " + tableName +" (Row COUNTER PRIMARY KEY, aColumn NUMBER , bColumn NUMBER)");
System.out.println("Table " + tableName + " created.");
}
}
conn.close();
}
}
catch (Exception f){
f.printStackTrace();
}
...
try{
statement.execute("DISABLE AUTOINCREMENT ON " + tableName );
statement.executeUpdate("INSERT INTO " + tableName
+ " ( Row, aColumn, bColumn)"
+ " VALUES ( "+(i+1)+", "+a+", "+b+")");
System.out.println("row " + i);
}
catch (Exception f ){
f.printStackTrace();
}
当我输入1
,2
,3
和4
作为我的值时,图表会显示以下内容:https://puu.sh/weGuX/3000d456bb.png
对于为什么会这样做的任何建议都会非常感谢,谢谢。
答案 0 :(得分:0)
NUMBER
DDL映射到Access中的Currency
字段类型,而在Access UI中则默认为" Number" type是" Long Integer"。如果要创建长整数列,请使用DDL关键字LONG
。