Results 1 to 3 of 3

Thread: petclinic sample with hibernate/mysql

  1. #1
    Join Date
    Aug 2004
    Posts
    2

    Default petclinic sample with hibernate/mysql

    Hello. I am very new to Spring, and have what I am afraid is a very, very naive question (with associated problem).

    I am attempting to deploy the petclinic sample included in Spring 1.1 RC2 to a resin 3.0 server in an effort to learn about Spring and related technology. I have several working webapps running under this server (jspwiki, and a couple of Struts apps).

    I have attempted to modify the petclinic configuration to use mysql by editing jdbc.properties appropriately:

    Code:
    jdbc.driverClassName=com.mysql.jdbc.Driver
    jdbc.url=jdbc:mysql://localhost:3306/petclinic
    jdbc.username=foo
    jdbc.password=
    I have made no other modifications to the app or resin configuration. I used the initDB.txt script to create the database, and all looks good there.

    When starting resin, I see no errors, warnings or other red flags. Among other things, it reports:

    Code:
    ...
    [15:14:51.594] Using dialect: net.sf.hibernate.dialect.MySQLDialect
    [15:14:51.602] Maximim outer join fetch depth: 2
    [15:14:51.607] Use outer join fetching: true
    [15:14:51.615] Initializing connection provider: org.springframework.orm.hibernate.LocalDataSourceConnectionProvider
    [15:14:51.633] No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
    [15:14:52.029] Use scrollable result sets: true
    [15:14:52.030] Use JDBC3 getGeneratedKeys(): true
    [15:14:52.030] Optimize cache for minimal puts: false
    [15:14:52.031] Query language substitutions: {}
    [15:14:52.031] cache provider: net.sf.hibernate.cache.EhCacheProvider
    [15:14:52.041] instantiating and configuring caches
    [15:14:52.731] building session factory
    [15:14:55.245] Not binding factory to JNDI, no JNDI name configured
    [15:14:55.246] Creating shared instance of singleton bean 'transactionManager'
    [15:14:55.503] Using DataSource [org.springframework.jdbc.datasource.DriverManagerDataSource@1f9338f] of Hibernate SessionFactory for HibernateTransactionManager
    ...
    [15:14:55.903] Database Product Name is MySQL
    [15:14:55.904] Driver Version is 2.0.14
    ...
    Deployment to resin works, and I can navigate the application. I added a 'vet' to the database by hand, and using the 'Display All vets' link displays the vet I added.

    However, when attempting to add an owner, I get an exception:

    Code:
    java.lang.AbstractMethodError: com.mysql.jdbc.jdbc2.Connection.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement;
    .
    .
    .
    So, I am guessing I have some silly configuration issue. Can anyone point me in the right direction?

    Thanks much,
    Ron

  2. #2
    Join Date
    Aug 2004
    Posts
    1,110

    Default

    Try using the MySQL Connector/J 3.0 driver. I don't think the 2.0 driver supports the generatedKey feature from the JDBC 3.0 spec.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

  3. #3
    Join Date
    Aug 2004
    Posts
    2

    Default petclinic sample with hibernate/mysql

    Quote Originally Posted by trisberg
    Try using the MySQL Connector/J 3.0 driver. I don't think the 2.0 driver supports the generatedKey feature from the JDBC 3.0 spec.
    Thanks very much Thomas, that did the trick.

    <sheepish grin>

    Ron

Similar Threads

  1. Replies: 0
    Last Post: Aug 30th, 2005, 12:59 AM
  2. petclinic client-server sample notes
    By robmoore in forum Swing
    Replies: 3
    Last Post: Apr 6th, 2005, 11:19 PM
  3. Replies: 2
    Last Post: Oct 26th, 2004, 10:50 AM
  4. Error during renaming in Petclinic sample
    By Patrick Vanhuyse in forum Swing
    Replies: 1
    Last Post: Oct 11th, 2004, 03:44 PM
  5. Replies: 2
    Last Post: Sep 1st, 2004, 10:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •