java - Manually connecting mySQL to eclipse/Spring Boot -
i wanted ask if need specify path sql file when using eclipse , spring boot? given same error cannot determine embedded database driver class database type none
. settings right, believe, problem never told eclipse databases are?
i have properties file states this:
spring.jpa.hibernate.ddl-auto=create-drop spring.datasource.url=jdbc:mysql://localhost:3306/db_example spring.datasource.username=springuser spring.datasource.password=thepassword spring.datasource.driverclassname=com.mysql.jdbc.driver spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.mysqldialect
is way find db_example, , should somehow online when start project? when go localhost:3306 shows error. haven't been able solve problem in 2 days, , pretty new programming please bear me!
dependecies (including hikaricp)
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>io.msela</groupid> <artifactid>course-api-data</artifactid> <version>0.0.1-snapshot</version> <packaging>jar</packaging> <name>course-api-data</name> <description>course api spring data</description> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.5.4.release</version> <relativepath/> <!-- lookup parent repository --> </parent> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> <project.reporting.outputencoding>utf-8</project.reporting.outputencoding> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupid>com.zaxxer</groupid> <artifactid>hikaricp</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-data-jpa</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-orm</artifactid> </dependency> <dependency> <groupid>org.hibernate</groupid> <artifactid>hibernate-core</artifactid> </dependency> <!-- <dependency> <groupid>org.apache.derby</groupid> <artifactid>derby</artifactid> <scope>runtime</scope> </dependency> --> <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-test</artifactid> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> </plugin> </plugins> </build> </project>
edit 1
i warning also:
2017-07-28 11:05:35.957 warn 9576 --- [ main] ationconfigembeddedwebapplicationcontext : exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'org.springframework.boot.autoconfigure.orm.jpa.hibernatejpaautoconfiguration': unsatisfied dependency expressed through constructor parameter 0; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/datasourceconfiguration$tomcat.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [org.apache.tomcat.jdbc.pool.datasource]: factory method 'datasource' threw exception; nested exception org.springframework.boot.autoconfigure.jdbc.datasourceproperties$datasourcebeancreationexception: cannot determine embedded database driver class database type none. if want embedded database please put supported 1 on classpath. if have database settings loaded particular profile may need active (no profiles active).
edit 3
the error message after moving folder following:
2017-07-28 11:40:20.348 warn 10944 --- [ main] ationconfigembeddedwebapplicationcontext : exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'org.springframework.boot.autoconfigure.orm.jpa.hibernatejpaautoconfiguration': unsatisfied dependency expressed through constructor parameter 0; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/datasourceconfiguration$tomcat.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [org.apache.tomcat.jdbc.pool.datasource]: factory method 'datasource' threw exception; nested exception java.lang.illegalstateexception: cannot load driver class: com.mysql.jdbc.driver
i dont see application.properties
in resource folder. application.properties
in test environment instead. wont work that.
Comments
Post a Comment