timyates / mod-jdbc-persistor

BusMod Persistor for JDBC support in vert.x
Other
36 stars 14 forks source link

No Suitable Driver #16

Closed mubbashar closed 10 years ago

mubbashar commented 10 years ago

I have created a module and i am using mod-jdbc-persistor module in it.

JsonObject dbconfig = new JsonObject() .putString("address", "com.bloidonia.jdbcpersistor") .putString("driver", "org.hsqldb.jdbcDriver") .putString("url", "jdbc:mysql://localhost:3306/db?zeroDateTimeBehavior=convertToNull") .putString("username", "root").putString("password", "") .putString("pmdKnownBroken", "no").putNumber("minpool", 5) .putNumber("maxpool", 20).putNumber("acquire", 5) .putNumber("batchtimeout", 5000);

    container.deployModule("com.bloidonia~mod-jdbc-persistor~2.1",
            dbconfig, 1, new Handler<AsyncResult<String>>() {
                @Override
                public void handle(AsyncResult<String> arg0) {
                    // TODO Auto-generated method stub
                    // System.out.println(arg0.succeeded());
                }
            });

the above code i am using to deploy the module in my verticle. It work fine. as i have attached the images below. But as soon as i changes some code in my project and gradle redeploy it. It start giving exception. the snap of error is also also attached. Can you tell why i am getting this. db_error_1 db_error

timyates commented 10 years ago

You seem to be using the hsqldb driver with a mysql connect string?

mubbashar commented 10 years ago

what should i use . should i use jdbc driver and where should i put the jar file ?

timyates commented 10 years ago

If you have a mysql database, you should use the mysql driver. So long as the mysql connector jar is on the classpath, it should be picked up by the module

mubbashar commented 10 years ago

change driver to "com.mysql.jdbc.Driver" and seems to be working fine. and i have added the mysql-connector-java-5.1.18-bin.jar to the build path in my eclipse.

timyates commented 10 years ago

Cool :-) I'll close this then :-)