#Connection Error between Spring Boot and MySQL :

16 messages · Page 1 of 1 (latest)

obsidian burrow
#

Application Properties:

spring.datasource.url=jdbc:mysql://localhost:3306/ems
spring.datasource.username=root
spring.datasource.password=admin1234

server.port = 5045
spring.jpa.properties..dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update

when i run this code, it doesn't make any table in mySql (ems database)

midnight parrotBOT
#

This post has been reserved for your question.

Hey @obsidian burrow! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

hallow ember
#

Can you please show the full stack trace?

obsidian burrow
#

this is my output

#

table doesn't show any feilds

weak vortexBOT
#

package entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.*;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor

@Entity

@Table(name="Employee") ```java
public class Employee {

@Id
@GeneratedValue
private long id;

//@Column(name="first_name")
private String firstname;
private String lastname;
private String email;

} ```

This message has been formatted automatically. You can disable this using /preferences.

hallow ember
obsidian burrow
#

yup

hallow ember
#

Entity classes must be in a subpackage of your main class

obsidian burrow
#

may be this is wrong ??

hallow ember
#

and the other packages should be as well

obsidian burrow
#

oo i see thanks alot

midnight parrotBOT
# obsidian burrow oo i see thanks alot

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.

obsidian burrow
#

i will try then tell you