It's one of those days where nothing works as it should.
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.cj.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/mz_db?useSSL=false&useLegacyDatetimecode=false" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
The above giving me this error message:
The reference to entity "useLegacyDatetimecode" must end with the ';' delimiter.
But the thing is that it is wrong:
jdbc:mysql://[host1][:port1][,[host2][:port2]]...[/[database]] »
[?propertyName1=propertyValue1[&propertyName2=propertyValue2]...]
es explained here.
Caused by: org.xml.sax.SAXParseException; lineNumber: 32; columnNumber: 105; The reference to entity "useLegacyDatetimecode" must end with the ';' delimiter.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
So what's this all about?
Similar to this. To embed an ampersand character in a url it needs to coded as &
<property name="url" value="jdbc:mysql://localhost:3306/mz_db?useSSL=false&useLegacyDatetimecode=false" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With