使用Spring org.springframework.jdbc.core.simple.SimpleJdbcInsert获得table的元数据的时候,报错:
org.springframework.dao.InvalidDataAccessApiUsageException: Configuration can't be altered once the class has been compiled or used
找了资料,是这么说的:
写道
compiled means you have instantiated a simpleJdbcInsert instance and set up data source and table name already. Once an simpleJdbcInsert instance is compiled, you should not re-config it again; for instance, set another table name. Create a new simpleJdbcInsert instace if you need to do so.
也就意味着,不能再spring里面像使用JdbcTemplate一样在一个spring上下文中使用一个单例。要想多次重复使用SimpleJdbcInsert,就需要每次都创建一个SimpleJdbcInsert的实例。也就是为一个数据源下面的一张表要单独创建一个SimpleJdbcInsert。
我将代码修改了,每次调用方法的时候,如下:
SimpleJdbcInsert simpleJdbcInsert = new SimpleJdbcInsert(jdbcTemplate);
就可以解决这个问题。
相关推荐
can stop in the operating system - i.e. there is a problem in the operating system/ device driver that prevents control being returned to the BurnInTest for that test. This was added for ...
Such an output can either be an input to another activity or a part of the process' delivery. 2.2. Process A “process” is a series of activities that lead towards a particular outcome. A process ...
Once the Registration Key has first been saved onto such one (1) computer for each one (1) purchased license the Registration Key may not be saved and the Registered Software may not be used on any ...
although they can be called in an asynchronous mode where the function returns as soon as all commands have been sent to the VariSpec, without waiting for them to run to completion. Another option ...
seems that some servers can‘t deglut the info too fast, causing problems with sockets buffers and leading to crash the client machine, I don‘t know if is a Borland bug or Microsoft bug. (thanks to ...
The latest versions of ICS can be downloaded from the ICS Wiki web site: http://wiki.overbyte.be/wiki/index.php/ICS_Download ICS V5 and V6 are archive releases no longer updated, last supported ...
For most operating environments, the default configuration of FTDIBUS is sufficient for normal operation, and it is very unlikely that any of the parameters described here need to be altered. ...
license, as long as the normal SFX banner has not been removed from the binary or disabled. 3. Altered versions--including, but not limited to, ports to new operating systems, existing ports with...
has shown that the Inductive Method can easily be extended to new security environments, which can then be studied formally. Such work enables the development of a new generation of automatic tools, ...
ROLLBACK语句后,再执行DML语句。(提交或回滚结束事务,接着的DML开启新事务)答案:A、B **知识点详解** 1. **Oracle数据库中的节省空间功能** - A....实际上,UNUSABLE属性只是标记索引为不可用,但其占用的空间...
These costs will be an amount of US$10 administration fee for every week the invoice has not been paid after 30 days and an interest of 15% -of the amount not paid- per year. In addition to these ...
- **Integrity**: Ensuring that data has not been altered during transmission. - **Authentication**: Verifying the identities of both parties involved in the communication. - **Non-repudiation**: ...
1.3. “Broadcom Product” means any of the proprietary integrated circuit product(s) sold by Broadcom with which the Software was designed to be used, or their successors. 1.4. “Derivative Work” ...
” where each developer slowly and carefully takes their best guess at how the out-of-control system can be altered to allow for new features, hoping that this doesn’t bring the whole stack of blocks...
The formatter can act on whole files, on limited lines, on specific offsets, passing through to standard-out (default) or altered in-place. There is no configurability as to the formatter's algorithm...
In PSK, the phase of the carrier is altered according to the input data. Among these, QPSK simultaneously modulates two orthogonal carrier waves, shifting their phases to represent two bits of ...
The add-in offers a transparent view of the protection results, allowing developers to see how the code has been altered and to make any necessary adjustments. Additionally, developers can insert ...
The start and finish of text introduced or altered by corrigendum is indicated in the text by tags. Text altered by IEC corrigendum December 2006 is indicated in the text by ˆ‰. Text altered by IEC ...