user2171396
user2171396

Reputation: 11

GraniteDS Hello sample project using Mysql instead of HSQLDB

I am new to JPA. Do anyone have any idea what else needs to be change in the sample to get it working with Mysql?

I was thinking the only changes that need to be done is the (jpa-config.xml)

I changed the data source to work with mysql.. I tested it out and its working. I create a table called Welcome on Mysql and have the columns name and message on it.

<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName">
        <value>com.mysql.jdbc.Driver</value>
    </property>
    <property name="url">
        <value>jdbc:mysql://localhost:3306/testdata</value>
    </property>
    <property name="username">
        <value>sa</value>
    </property>
    <property name="password">
        <value>sa</value>
    </property>
</bean>

I am geting an error "org.hibernate.exception.SQLGrammarEXception: could not execute query" whenever I try to insert an entry through the sample.

Upvotes: 1

Views: 164

Answers (0)

Related Questions