Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE SP_INS_PAGEID(
- IN in_page_id bigint(20))
- MODIFIES SQL DATA
- BEGIN ATOMIC
- INSERT INTO NOTIFICATION VALUES (in_page_id);
- END
- <jdbc:embedded-database id="daqDS" type="HSQL" database-name="LEADGENDB">
- <jdbc:script location="classpath:db/create-db.sql" separator="@" />
- <jdbc:script location="classpath:db/insert-data.sql" />
- </jdbc:embedded-database>
- private JdbcTemplate JdbcTemplate;
- private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
- @Autowired
- public void setDataSource(DataSource dataSource) {
- this.JdbcTemplate = new JdbcTemplate(dataSource);
- this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
- }
- @Test
- public void testStoredProc() throws SQLException
- try{
- SimpleJdbcCall simpleJdbcCall = new SimpleJdbcCall(JdbcTemplate).withProcedureName("SP_INS_PAGEID");
- SqlParameterSource in = new MapSqlParameterSource() .addValue("in_page_id", 34);
- Map<String, Object> result = simpleJdbcCall.execute(in);
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement