使用jdbctemplate更改序列

时间:2013-07-23 14:21:28

标签: sql spring jdbctemplate

我需要使用jdbc模板执行以下alter命令(不确定是否可以在jdbctemplate中使用alter语句)。

ALTER SEQUENCE MY_SEQ INCREMENT BY<&gt ;;

该号码将动态传递。

请帮忙。

由于

1 个答案:

答案 0 :(得分:-1)

这是我的功能。

{ "name": "todo", "version": "0.1.0", "private": true, "devDependencies": { "autoprefixer-stylus": "^0.13.0", "concurrently": "^3.1.0", "react-scripts": "0.8.5", "stylus": "^0.54.5" }, "dependencies": { "react": "^15.4.2", "react-dom": "^15.4.2", "react-router": "^4.0.0-alpha.6" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", "styles": "stylus -u autoprefixer-stylus ./src/**/*.styl -o ./src/css/", "styles:watch": "stylus -u autoprefixer-stylus -w ./src/**/*.styl -o ./src/css/", "watch": "concurrently --names 'webpack, stylus' --prefix name 'npm run start' 'npm run styles:watch'" } }

int incremento= 10;

String sql="ALTER SEQUENCE esquema.scuencia INCREMENT BY ";

String update=sql+incrmento;

用户需要具有修改序列的特权。