You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Julian Cable (JIRA)" <ji...@apache.org> on 2011/06/25 00:57:47 UTC

[jira] [Updated] (CAMEL-4152) jdbc idempotent repository - table creation

     [ https://issues.apache.org/jira/browse/CAMEL-4152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Cable updated CAMEL-4152:
--------------------------------

         Labels: idempotent jdbc  (was: docuentation idempotent jdbc)
    Description: 
 It would be nice if the class caught the error if the table does not exist and tried to create it. If the create privilege is not available then a more informative exception can be raised to inform the user what needs creating.

I also suggest the schema is changed so that the fields are lower case as different database engines handle case differently and use incompatible quoting for mixed case tables (Oracle, MySql and Postgres are all slightly different).

Julian

  was:
 I couldn't find any reference to using this with spring DSL. I came up with this which seems to work:

	<bean id="myRepo" class="org.apache.camel.processor.idempotent.jdbc.JdbcMessageIdRepository">
		<constructor-arg index="0" ref="myJDBC"/>
		<constructor-arg index="1" value="foobar"/>
	</bean>

	<bean id="myJDBC" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
		<property name="url" value="${myJDBC.uri}" />
		<property name="username" value="${myJDBC.username}" />
		<property name="password" value="${myJDBC.password}" />
	</bean>

I think it would be better if the class had a default constructor and looked for properties.

Julian


> jdbc idempotent repository - table creation
> -------------------------------------------
>
>                 Key: CAMEL-4152
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4152
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-sql
>    Affects Versions: 2.7.1
>         Environment: camels on any
>            Reporter: Julian Cable
>            Assignee: Christian Müller
>              Labels: idempotent, jdbc
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
>  It would be nice if the class caught the error if the table does not exist and tried to create it. If the create privilege is not available then a more informative exception can be raised to inform the user what needs creating.
> I also suggest the schema is changed so that the fields are lower case as different database engines handle case differently and use incompatible quoting for mixed case tables (Oracle, MySql and Postgres are all slightly different).
> Julian

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira