Closed w25r closed 7 years ago
Will do. In the meantime, do you think in memory database like derby or H2 could be handy for testing? They may be a little old(but gold?). I can ask around for some recommendations
On Jul 15, 2017 11:46 AM, "William Lichtenberger" notifications@github.com wrote:
This builds on #14 https://github.com/gradle/ge-export/pull/14. @wisechengyi https://github.com/wisechengyi please review this when you have a chance and even test it out next week.
You can view, comment on, or merge this pull request online at:
https://github.com/gradle/ge-export/pull/16 Commit Summary
- First stab at MySQL support
- Merge branch 'properties' of github.com:gradle/ge-export into add-mysql-support
- Make database configurable
- Fix connection problems by closing connections.
File Changes
- M build.gradle https://github.com/gradle/ge-export/pull/16/files#diff-0 (10)
- M src/main/java/com/gradle/exportapi/Application.java https://github.com/gradle/ge-export/pull/16/files#diff-1 (16)
- M src/main/java/com/gradle/exportapi/dao/BuildDAO.java https://github.com/gradle/ge-export/pull/16/files#diff-2 (14)
- M src/main/java/com/gradle/exportapi/dbutil/SqlHelper.java https://github.com/gradle/ge-export/pull/16/files#diff-3 (32)
- A src/main/resources/mysql-sql.properties https://github.com/gradle/ge-export/pull/16/files#diff-4 (74)
Patch Links:
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gradle/ge-export/pull/16, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkZhsNCw0w6CU8-A_0ixSL61Ok5zGLbks5sOQkfgaJpZM4OZGC2 .
On Jul 15, 2017 11:46 AM, "William Lichtenberger" notifications@github.com wrote:
This builds on #14 https://github.com/gradle/ge-export/pull/14. @wisechengyi https://github.com/wisechengyi please review this when you have a chance and even test it out next week.
You can view, comment on, or merge this pull request online at:
https://github.com/gradle/ge-export/pull/16 Commit Summary
- First stab at MySQL support
- Merge branch 'properties' of github.com:gradle/ge-export into add-mysql-support
- Make database configurable
- Fix connection problems by closing connections.
File Changes
- M build.gradle https://github.com/gradle/ge-export/pull/16/files#diff-0 (10)
- M src/main/java/com/gradle/exportapi/Application.java https://github.com/gradle/ge-export/pull/16/files#diff-1 (16)
- M src/main/java/com/gradle/exportapi/dao/BuildDAO.java https://github.com/gradle/ge-export/pull/16/files#diff-2 (14)
- M src/main/java/com/gradle/exportapi/dbutil/SqlHelper.java https://github.com/gradle/ge-export/pull/16/files#diff-3 (32)
- A src/main/resources/mysql-sql.properties https://github.com/gradle/ge-export/pull/16/files#diff-4 (74)
Patch Links:
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gradle/ge-export/pull/16, or mute the thread https://github.com/notifications/unsubscribe-auth/AAkZhsNCw0w6CU8-A_0ixSL61Ok5zGLbks5sOQkfgaJpZM4OZGC2 .
I don't think it's worth testing in memory. I think it will be straightforward to spin up docker containers for MySql and Postgres to run the integration tests on Travis CI.
ah ok sounds good. seems pretty straightforward to setup the DBs in travis.
what should db-info.properties look like? I have the following:
jdbcUrl=jdbc:mysql://localhost:3306
username=root
password=password
maximumPoolSize=5
but errors were thrown:
11:24:21.191 [main] INFO com.gradle.exportapi.Application - Validating connection to the target database from configuration file: db-info.properties
11:24:21.243 [main] INFO com.zaxxer.hikari.HikariDataSource - yank-default - Started.
Tue Jul 18 11:24:21 PDT 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
11:24:21.423 [main] ERROR com.gradle.exportapi.Application - Unable to connect to the target database. Please validate your configuration settings.
11:24:21.425 [main] ERROR com.gradle.exportapi.Application - Export failed
java.lang.RuntimeException: Failed to establish connection to target database.
at com.gradle.exportapi.Application.main(Application.java:62)
Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: The server time zone value 'PDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:512)
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:105)
at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:71)
at org.knowm.yank.YankPoolManager.createPool(YankPoolManager.java:101)
at org.knowm.yank.YankPoolManager.addDefaultConnectionPool(YankPoolManager.java:69)
at org.knowm.yank.Yank.setupDefaultConnectionPool(Yank.java:718)
at com.gradle.exportapi.Application.main(Application.java:58)
Caused by: java.sql.SQLException: The server time zone value 'PDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:505)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:479)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:489)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:69)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1606)
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:633)
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:347)
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:219)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:95)
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:101)
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:341)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:506)
... 6 common frames omitted
Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value 'PDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
at com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:118)
at com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:293)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:2399)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1739)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1596)
... 13 common frames omitted
You need to specify the database at the end of the connection string. I called mine geexport (hyphens cause problems for MySQL)
On Tue, Jul 18, 2017 at 1:04 PM Yi Cheng notifications@github.com wrote:
what should db-info.properties look like? I have the following:
jdbcUrl=jdbc:mysql://localhost:3306 username=root password=password maximumPoolSize=5
but errors were thrown:
11:02:43.100 [main] ERROR com.gradle.exportapi.Application - Unable to connect to the target database. Please validate your configuration settings. 11:02:43.101 [main] ERROR com.gradle.exportapi.Application - Export failed java.lang.RuntimeException: Failed to establish connection to target database.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gradle/ge-export/pull/16#issuecomment-316146980, or mute the thread https://github.com/notifications/unsubscribe-auth/ACMBtn735Lo6SvbSJBMHOW72hXarFbeoks5sPPOTgaJpZM4OZGC2 .
--
[image: Email-Signature@2x.png]
William Herbert Lichtenberger
Principal Engineer
Gradle W. gradle.com https://www.gradle.com
Gradle Summit is now open Click HERE to register https://summit.gradle.com/
ok cool got it rolling. although i have to specify timezone related things like below in db-info.properties otherwise it will throw error.
jdbcUrl=jdbc:mysql://localhost:3306/ge?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTi...
Caused by: com.mysql.cj.core.exceptions.InvalidConnectionAttributeException: The server time zone value 'PDT' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:54)
at com.mysql.cj.core.exceptions.ExceptionFactory.createException(ExceptionFactory.java:73)
at com.mysql.cj.jdbc.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:118)
at com.mysql.cj.mysqla.MysqlaSession.configureTimezone(MysqlaSession.java:293)
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:2399)
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:1739)
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1596)
This builds on #14. @wisechengyi please review this when you have a chance and even test it out next week.
Fixes #3