偶用nutz创建表, 报如下错,
DataSource 可以正常获得
但是创建表这一步有点问题, 过不去
貌似是因为驱动没有实现 savepoint(), 就是存储事务点,
如何解决呢,
org.nutz.dao.DaoException: com.mysql.jdbc.NotImplemented: Feature not implemented
详细错误
2012-06-16 12:39:01 DEBUG [main] Get 'comboPooledDataSource'<class com.mchange.v2.c3p0.ComboPooledDataSource>
2012-06-16 12:39:01 DEBUG [main] >> Load definition
2012-06-16 12:39:01 DEBUG [main] >> Make...'comboPooledDataSource'<class com.mchange.v2.c3p0.ComboPooledDataSource>
2012-06-16 12:39:01 DEBUG [main] class com.mchange.v2.c3p0.ComboPooledDataSource , no config to enable AOP.
2012-06-16 12:39:01 DEBUG [main] Save object 'comboPooledDataSource' to [app]
2012-6-16 12:39:01 com.mchange.v2.log.MLog <clinit>
信息: MLog clients using java 1.4+ standard logging.
2012-6-16 12:39:01 com.mchange.v2.c3p0.C3P0Registry banner
信息: Initializing c3p0-0.9.2-pre2 [built 18-May-2012 10:14:10 -0400; debug? true; trace: 10]
2012-06-16 12:39:01 INFO [main] Init file-pool by: ~/.nutz/tmp/dao/ [2000]
2012-06-16 12:39:01 DEBUG [main] file-pool.home: 'C:\Documents and Settings\sanshizi\.nutz\tmp\dao'
2012-06-16 12:39:01 INFO [main] file-pool.cursor: 0
2012-06-16 12:39:01 DEBUG [main] Jdbcs init complete
2012-6-16 12:39:01 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgekn88n1vl4fm01rr4e7u|2a5330, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> org.gjt.mm.mysql.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgekn88n1vl4fm01rr4e7u|2a5330, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql://localhost:3306/woele, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]
2012-06-16 12:39:02 DEBUG [main] Database info --> MYSQL:[MySQL - 5.1.28-rc-community]
2012-06-16 12:39:02 DEBUG [main] Table 't_customer' doesn't exist!
2012-06-16 12:39:02 DEBUG [main] Table 't_customer' doesn't exist!
Exception in thread "main" org.nutz.dao.DaoException: com.mysql.jdbc.NotImplemented: Feature not implemented
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:49)
at org.nutz.dao.impl.DaoSupport$DaoExec.run(DaoSupport.java:211)
at org.nutz.trans.Trans.exec(Trans.java:123)
at org.nutz.trans.Trans.exec(Trans.java:81)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:184)
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:175)
at org.nutz.dao.impl.jdbc.mysql.MysqlJdbcExpert.createEntity(MysqlJdbcExpert.java:144)
at org.nutz.dao.impl.NutDao.create(NutDao.java:654)
at com.woele.bo.Bo.createTable(Bo.java:23)
at com.woele.bo.Bo.main(Bo.java:30)
Caused by: com.mysql.jdbc.NotImplemented: Feature not implemented
at com.mysql.jdbc.Connection.setSavepoint(Connection.java:843)
at com.mchange.v2.c3p0.impl.NewProxyConnection.setSavepoint(NewProxyConnection.java:1252)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:29)
... 9 more
Java Result: 1
成功生成(总时间:2 秒)
我的配置
<ioc xsi:noNamespaceSchemaLocation="nutz-ioc-0.1.xsd">
<obj name="comboPooledDataSource" type="com.mchange.v2.c3p0.ComboPooledDataSource">
<events>
<depose>close</depose>
</events>
<field name="driverClass">
<str>org.gjt.mm.mysql.Driver</str>
</field>
<field name="jdbcUrl">
<str>jdbc:mysql://localhost:3306/www</str>
</field>
<field name="user">
<str>root</str>
</field>
<field name="password">
<str>123456</str>
</field>
</obj>
</ioc>
<!--
org.gjt.mm.mysql.Driver
com.mysql.jdbc.Driver
?useUnicode=true&characterEncoding=
-->
----------------------------------------------------------------------------
问题解决了: 原来是jdbc驱动太老了, 下载了一个5.0的, 搞定