Home grails 3.0.2 mysql connectivity
Reply: 0

grails 3.0.2 mysql connectivity

user2438
1#
user2438 Published in June 25, 2018, 8:01 am

I have installed grails 3.0.2 and xampp server on my system. I want to connect to MySql of Xampp through grails. So made some changes in application.yml file located at grails-app/conf folder now it looks like

dataSource:
pooled: true
jmxExport: true
driverClassName: "com.mysql.jdbc.JDBC4MySQLConnection"//changed driver class
username: root                            //username 
password: 123456                          //password

//now in develoment environments i changed dbCreat->update and

//url-> jdbc:mysql://localhost:3306/myDB //i have not made any changes to test and production environments

environments:

development:
    dataSource:
        dbCreate: update
        url: jdbc:mysql://localhost:3306/myDB;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
test:
    dataSource:
        dbCreate: update
        url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
    dataSource:
        dbCreate: update
        url: jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE

I am new to grails so i don't know where to place mysql-connector.jar but i have added path of my mysql-connector.jar in .dependencies file located at myProject/build folder.

When i try to run my app it gives a lot of errors and in end it gives exception as

Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.JDBC4MySQLConnection at java.net.URLClassLoader$1.run(URLClassLoader.java:372) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:360) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:340) at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(Poole dConnection.java:246) ... 83 more

i am not able to understand error. If their is any step my step tutorial for mysql connection with grails 3.0.2 and jdk 1.8 please post link.

Thanks in advance.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.329244 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO