Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.JdbcTemplate.update()


    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status=null;
    try {
      status=transactionManager.getTransaction(definition);
      JdbcTemplate template=new JdbcTemplate(getDataSource());
      template.update(UPDATE_FIELD_REQUEST,
          new Object[] {TEST_FIELD_VALUE,new Integer(FIELD_ID)},
          new int[] {Types.VARCHAR,Types.INTEGER});
      transactionManager.rollback(status);
    } catch(Exception ex) {
      ex.printStackTrace();
View Full Code Here


    this.connectionFactory = connectionFactory;
  }

  private void updateDatabase(String ddlRequest) {
    JdbcTemplate template=new JdbcTemplate(getDataSource());
    template.update(ddlRequest);
  }
 
  protected String[] getConfigLocations() {
    return new String[] { "org/jencks/samples/outbound/jencks-multiple.xml" };
  }
View Full Code Here

    try {
      status=transactionManager.getTransaction(definition);

      //JDBC
      JdbcTemplate jdbcTemplate=new JdbcTemplate(getDataSource());
      jdbcTemplate.update(UPDATE_FIELD_REQUEST,
          new Object[] {TEST_FIELD_VALUE,new Integer(FIELD_ID)},
          new int[] {Types.VARCHAR,Types.INTEGER});
      //JMS
      JmsTemplate jmsTemplate=new JmsTemplate(getConnectionFactory());
      jmsTemplate.convertAndSend(queue,TEST_MESSAGE);
View Full Code Here

    try {
      status=transactionManager.getTransaction(definition);

      //JDBC
      JdbcTemplate jdbcTemplate=new JdbcTemplate(getDataSource());
      jdbcTemplate.update(UPDATE_FIELD_REQUEST,
          new Object[] {TEST_FIELD_VALUE,new Integer(FIELD_ID)},
          new int[] {Types.VARCHAR,Types.INTEGER});
      //JMS
      JmsTemplate jmsTemplate=new JmsTemplate(getConnectionFactory());
      jmsTemplate.convertAndSend(queue,TEST_MESSAGE);
View Full Code Here

            String value = jdbcTemplate.queryForObject(
                    "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
            assertEquals("virattrcache", value);

            jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", userTO.getId());

            value = jdbcTemplate.queryForObject(
                    "SELECT USERNAME FROM testsync WHERE ID=?", String.class, userTO.getId());
            assertEquals("virattrcache2", value);
View Full Code Here

        String value = jdbcTemplate.queryForObject(
                "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
        assertEquals("virattrcache", value);

        jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", actual.getId());

        value = jdbcTemplate.queryForObject(
                "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
        assertEquals("virattrcache2", value);
        // ----------------------------------------
View Full Code Here

        String value = jdbcTemplate.queryForObject(
                "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
        assertEquals("virattrcache", value);

        jdbcTemplate.update("UPDATE testsync set USERNAME='virattrcache2' WHERE ID=?", actual.getId());

        value = jdbcTemplate.queryForObject(
                "SELECT USERNAME FROM testsync WHERE ID=?", String.class, actual.getId());
        assertEquals("virattrcache2", value);
        // ----------------------------------------
View Full Code Here

                    replaceAll("org\\.apache\\.syncope\\.types\\.",
                    "org.apache.syncope.common.types").
                    replaceAll("org/apache/syncope/types/",
                    "org/apache/syncope/common/types/").
                    getBytes();
            jdbcTemplate.update("UPDATE ACT_GE_BYTEARRAY SET BYTES_=? WHERE ID_=?",
                    new Object[] {updated, row.get("ID_")});
        }
    }

    private String upgradeSyncopeConf() {
View Full Code Here

                jdbcTemplate.queryForList("SELECT id, serializedInstance FROM ReportletConfInstance");
        for (Map<String, Object> row : rcInstances) {
            String updated = ((String) row.get("serializedInstance")).
                    replaceAll("org\\.apache\\.syncope\\.client\\.report\\.",
                    "org.apache.syncope.common.report.");
            jdbcTemplate.update("UPDATE ReportletConfInstance SET serializedInstance=? WHERE id=?",
                    new Object[] {updated, row.get("id")});
        }
    }

    private void upgradeUserRequest() {
View Full Code Here

        JdbcTemplate template = new JdbcTemplate( dataSource );

        // if this is a new node, insert it
        if( id == null ) {
            JdbcSettings parent = (JdbcSettings) getParent();
            template.update( "INSERT INTO SETTINGS (KEY, PARENT, USER) VALUES (?, ?, ?)", new Object[] { getName(),
                    parent == null ? null : parent.getId(), user } );
            id = Integer.valueOf( template.queryForInt( "SELECT MAX(ID) FROM SETTINGS" ) );
        } else {
            for( Iterator iter = remove.iterator(); iter.hasNext(); ) {
                String key = (String) iter.next();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.