日期:2014-05-16  浏览次数:20538 次

spring+mybatis+sqlite(dbcp做连接池)

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${db.driverClassName}"/>
<property name="url" value="${db.url}"/>
<property name="username" value="${db.username}"/>
<property name="password" value="${db.password}"/>
<property name="initialSize" value="10" />
<property name="maxActive" value="100" />
<property name="maxIdle" value="100" />
<property name="poolPreparedStatements" value="true" />
</bean>


<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:mybatis/mybatis-config.xml"></property>
</bean>

?

?

?

app.home=D:/soft/sqlite/db
db.dir=D:/soft/sqlite/db/kserver.db
db.driverClassName=org.sqlite.JDBC
db.name=kserver.db
db.url=jdbc:sqlite:D:/soft/sqlite/db/kserver.db
db.username=
db.password=

?

?

?

错误:

Cause: java.sql.SQLException: not implemented by SQLite JDBC driver
; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; not implemented by SQLite JDBC driver; nested exception is java.sql.SQLException: not implemented by SQLite JDBC driver

?

有的属性不支持,如: private BigDecimal workFactor;

?

?

java.sql.BatchUpdateException: batch entry 0: [SQLITE_ERROR] SQL error or missing database (near "=": syntax error)

db.username=root(不能为空)
db.password=root(不能为空)