I am using Spring Boot (1.4.7) and MyBatis.
spring.main1.datasource.url=jdbc:mariadb://192.168.0.11:3306/testdb?useUnicode=true&characterEncoding=utf8&autoReconnect=true&socketTimeout=5000&connectTimeout=3000 spring.main1.datasource.username=username spring.main1.datasource.password=password spring.main1.datasource.driverClassName=org.mariadb.jdbc.Driver spring.main1.datasource.tomcat.test-on-borrow=true spring.main1.datasource.tomcat.test-while-idle=true spring.main1.datasource.tomcat.validation-query=SELECT 1 spring.main1.datasource.tomcat.validation-query-timeout=5000 spring.main1.datasource.tomcat.validation-interval=5000 spring.main1.datasource.tomcat.max-wait=5000 spring.main1.datasource.continue-on-error=true
I cannot start the program with errors when the database is disconnected on the Eclipse or Linux server. (The database is not located on the local host.)
When I try to run the program with the database disconnected, print this out.
java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=192.168.0.11)(port=3306)(type=master) : connect timed out Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=192.168.0.11)(port=3306)(type=master) : connect timed out Stopping service [Tomcat] Application startup failed
Is there anyway?
thanks
source share