File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
embulk-input-mysql/src/main/java/org/embulk/input/mysql Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -158,8 +158,9 @@ private void loadTimeZoneMappingsIfNeeded()
158
158
// property file because the file should be in the same classpath with the class.
159
159
// Here implements a workaround as a workaround.
160
160
//
161
- // It's not 100% sure, but this workaround is necessary for Connector/J 5.x (com.mysql.jdbc.TimeUtil)
162
- // only.
161
+ // This workaround seems required only for Connector/J 5.x (com.mysql.jdbc.TimeUtil),
162
+ // not necessary for Connector/J 8.x (com.mysql.cj.util.TimeUtil).
163
+ // TODO: Clarify for Connector/J 8.x just in case.
163
164
Field f = null ;
164
165
try {
165
166
Class <?> timeUtilClass = Class .forName ("com.mysql.jdbc.TimeUtil" );
@@ -176,9 +177,14 @@ private void loadTimeZoneMappingsIfNeeded()
176
177
}
177
178
}
178
179
catch (ClassNotFoundException e ) {
179
- // It appears that the user uses the Connector/J 8.x driver.
180
- // Do nothing;
180
+ try {
181
+ Class .forName ("com.mysql.cj.util.TimeUtil" );
182
+ } catch (final ClassNotFoundException ex2 ) {
183
+ // Throw if neither the Connector/J 5.x nor 8.x driver is found.
184
+ throw new RuntimeException (e );
185
+ }
181
186
}
187
+ // Pass-through if the Connector/J 8.x driver is found. }
182
188
catch (IllegalAccessException | NoSuchFieldException | IOException e ) {
183
189
throw new RuntimeException (e );
184
190
}
You can’t perform that action at this time.
0 commit comments