Can't connect AWS RDS from local Spring boot
I can connect AWS RDS using MySQL Workbench but when trying to connect from local spring boot, it says table doesn't exist. Same code working with my local MySQL.
So not sure what would the problem.
application.properties
spring.datasource.url = jdbc:mysql://host:3306/db
spring.datasource.username = user
spring.datasource.password = password-1
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
error message:
HHH000397: Using ASTQueryTranslatorFactory
SQL Error: 1146, SQLState: 42S02
Table 'db.student' doesn't exist
Resolved [org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet]
HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1m42s281ms410µs591ns).
Any idea to for this error. Appreciate you help!
spring spring-boot spring-data-jpa
|
show 1 more comment
I can connect AWS RDS using MySQL Workbench but when trying to connect from local spring boot, it says table doesn't exist. Same code working with my local MySQL.
So not sure what would the problem.
application.properties
spring.datasource.url = jdbc:mysql://host:3306/db
spring.datasource.username = user
spring.datasource.password = password-1
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
error message:
HHH000397: Using ASTQueryTranslatorFactory
SQL Error: 1146, SQLState: 42S02
Table 'db.student' doesn't exist
Resolved [org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet]
HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1m42s281ms410µs591ns).
Any idea to for this error. Appreciate you help!
spring spring-boot spring-data-jpa
Kindly provide theapplication.propertiesfile. Remember to change/erase the sensitive data.
– Pijotrek
Jan 18 at 13:46
Config looks okay. Can you also provide the log? We would like to see the error probably.
– Pijotrek
Jan 18 at 13:58
Updated error message
– user2848031
Jan 18 at 14:16
do you have student table in your db schema
– Sasikumar Murugesan
Jan 18 at 14:17
If I understand the error log correctly, something is wrong with your code/schema. It obtained connection to the DB.
– Pijotrek
Jan 18 at 14:18
|
show 1 more comment
I can connect AWS RDS using MySQL Workbench but when trying to connect from local spring boot, it says table doesn't exist. Same code working with my local MySQL.
So not sure what would the problem.
application.properties
spring.datasource.url = jdbc:mysql://host:3306/db
spring.datasource.username = user
spring.datasource.password = password-1
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
error message:
HHH000397: Using ASTQueryTranslatorFactory
SQL Error: 1146, SQLState: 42S02
Table 'db.student' doesn't exist
Resolved [org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet]
HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1m42s281ms410µs591ns).
Any idea to for this error. Appreciate you help!
spring spring-boot spring-data-jpa
I can connect AWS RDS using MySQL Workbench but when trying to connect from local spring boot, it says table doesn't exist. Same code working with my local MySQL.
So not sure what would the problem.
application.properties
spring.datasource.url = jdbc:mysql://host:3306/db
spring.datasource.username = user
spring.datasource.password = password-1
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
error message:
HHH000397: Using ASTQueryTranslatorFactory
SQL Error: 1146, SQLState: 42S02
Table 'db.student' doesn't exist
Resolved [org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet]
HikariPool-1 - Thread starvation or clock leap detected (housekeeper delta=1m42s281ms410µs591ns).
Any idea to for this error. Appreciate you help!
spring spring-boot spring-data-jpa
spring spring-boot spring-data-jpa
edited Jan 18 at 14:16
user2848031
asked Jan 18 at 13:40
user2848031user2848031
36562144
36562144
Kindly provide theapplication.propertiesfile. Remember to change/erase the sensitive data.
– Pijotrek
Jan 18 at 13:46
Config looks okay. Can you also provide the log? We would like to see the error probably.
– Pijotrek
Jan 18 at 13:58
Updated error message
– user2848031
Jan 18 at 14:16
do you have student table in your db schema
– Sasikumar Murugesan
Jan 18 at 14:17
If I understand the error log correctly, something is wrong with your code/schema. It obtained connection to the DB.
– Pijotrek
Jan 18 at 14:18
|
show 1 more comment
Kindly provide theapplication.propertiesfile. Remember to change/erase the sensitive data.
– Pijotrek
Jan 18 at 13:46
Config looks okay. Can you also provide the log? We would like to see the error probably.
– Pijotrek
Jan 18 at 13:58
Updated error message
– user2848031
Jan 18 at 14:16
do you have student table in your db schema
– Sasikumar Murugesan
Jan 18 at 14:17
If I understand the error log correctly, something is wrong with your code/schema. It obtained connection to the DB.
– Pijotrek
Jan 18 at 14:18
Kindly provide the
application.properties file. Remember to change/erase the sensitive data.– Pijotrek
Jan 18 at 13:46
Kindly provide the
application.properties file. Remember to change/erase the sensitive data.– Pijotrek
Jan 18 at 13:46
Config looks okay. Can you also provide the log? We would like to see the error probably.
– Pijotrek
Jan 18 at 13:58
Config looks okay. Can you also provide the log? We would like to see the error probably.
– Pijotrek
Jan 18 at 13:58
Updated error message
– user2848031
Jan 18 at 14:16
Updated error message
– user2848031
Jan 18 at 14:16
do you have student table in your db schema
– Sasikumar Murugesan
Jan 18 at 14:17
do you have student table in your db schema
– Sasikumar Murugesan
Jan 18 at 14:17
If I understand the error log correctly, something is wrong with your code/schema. It obtained connection to the DB.
– Pijotrek
Jan 18 at 14:18
If I understand the error log correctly, something is wrong with your code/schema. It obtained connection to the DB.
– Pijotrek
Jan 18 at 14:18
|
show 1 more comment
1 Answer
1
active
oldest
votes
one way to find out is to use spring.jpa.hibernate.ddl-auto=create this would create a table named student in your db based on your current entity class. I am suspecting your student table has uppercase in it? Because hibernate implcitly maps your table name, say @Table(name = "MyTable"), to my_table. Say you have @Table(name="Student") and your table in your database is named Student. Assuming Hibernate 5, you need to override Hibernate's ImplicitNamingStrategy by setting spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl. Or you could provide your own, for reference: https://www.baeldung.com/hibernate-naming-strategy
Yes , i noticed error message all small letters but actual table name all capital letters. Hope thats is the reason having issue. How to make non-case sensitive to access database using hibernate ? or any alternative to use these type of cases. Please advise.
– user2848031
Jan 18 at 19:53
1
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpladding this to your properties file would override theImplicitNamingStrategywhich Spring auto configuration uses by default. Doing so allows@Table(name = "Student")to map to Student table in your actual database.
– 夢のの夢
Jan 18 at 21:08
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54255231%2fcant-connect-aws-rds-from-local-spring-boot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
one way to find out is to use spring.jpa.hibernate.ddl-auto=create this would create a table named student in your db based on your current entity class. I am suspecting your student table has uppercase in it? Because hibernate implcitly maps your table name, say @Table(name = "MyTable"), to my_table. Say you have @Table(name="Student") and your table in your database is named Student. Assuming Hibernate 5, you need to override Hibernate's ImplicitNamingStrategy by setting spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl. Or you could provide your own, for reference: https://www.baeldung.com/hibernate-naming-strategy
Yes , i noticed error message all small letters but actual table name all capital letters. Hope thats is the reason having issue. How to make non-case sensitive to access database using hibernate ? or any alternative to use these type of cases. Please advise.
– user2848031
Jan 18 at 19:53
1
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpladding this to your properties file would override theImplicitNamingStrategywhich Spring auto configuration uses by default. Doing so allows@Table(name = "Student")to map to Student table in your actual database.
– 夢のの夢
Jan 18 at 21:08
add a comment |
one way to find out is to use spring.jpa.hibernate.ddl-auto=create this would create a table named student in your db based on your current entity class. I am suspecting your student table has uppercase in it? Because hibernate implcitly maps your table name, say @Table(name = "MyTable"), to my_table. Say you have @Table(name="Student") and your table in your database is named Student. Assuming Hibernate 5, you need to override Hibernate's ImplicitNamingStrategy by setting spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl. Or you could provide your own, for reference: https://www.baeldung.com/hibernate-naming-strategy
Yes , i noticed error message all small letters but actual table name all capital letters. Hope thats is the reason having issue. How to make non-case sensitive to access database using hibernate ? or any alternative to use these type of cases. Please advise.
– user2848031
Jan 18 at 19:53
1
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpladding this to your properties file would override theImplicitNamingStrategywhich Spring auto configuration uses by default. Doing so allows@Table(name = "Student")to map to Student table in your actual database.
– 夢のの夢
Jan 18 at 21:08
add a comment |
one way to find out is to use spring.jpa.hibernate.ddl-auto=create this would create a table named student in your db based on your current entity class. I am suspecting your student table has uppercase in it? Because hibernate implcitly maps your table name, say @Table(name = "MyTable"), to my_table. Say you have @Table(name="Student") and your table in your database is named Student. Assuming Hibernate 5, you need to override Hibernate's ImplicitNamingStrategy by setting spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl. Or you could provide your own, for reference: https://www.baeldung.com/hibernate-naming-strategy
one way to find out is to use spring.jpa.hibernate.ddl-auto=create this would create a table named student in your db based on your current entity class. I am suspecting your student table has uppercase in it? Because hibernate implcitly maps your table name, say @Table(name = "MyTable"), to my_table. Say you have @Table(name="Student") and your table in your database is named Student. Assuming Hibernate 5, you need to override Hibernate's ImplicitNamingStrategy by setting spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl. Or you could provide your own, for reference: https://www.baeldung.com/hibernate-naming-strategy
edited Jan 18 at 21:33
answered Jan 18 at 14:43
夢のの夢夢のの夢
1,28921022
1,28921022
Yes , i noticed error message all small letters but actual table name all capital letters. Hope thats is the reason having issue. How to make non-case sensitive to access database using hibernate ? or any alternative to use these type of cases. Please advise.
– user2848031
Jan 18 at 19:53
1
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpladding this to your properties file would override theImplicitNamingStrategywhich Spring auto configuration uses by default. Doing so allows@Table(name = "Student")to map to Student table in your actual database.
– 夢のの夢
Jan 18 at 21:08
add a comment |
Yes , i noticed error message all small letters but actual table name all capital letters. Hope thats is the reason having issue. How to make non-case sensitive to access database using hibernate ? or any alternative to use these type of cases. Please advise.
– user2848031
Jan 18 at 19:53
1
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpladding this to your properties file would override theImplicitNamingStrategywhich Spring auto configuration uses by default. Doing so allows@Table(name = "Student")to map to Student table in your actual database.
– 夢のの夢
Jan 18 at 21:08
Yes , i noticed error message all small letters but actual table name all capital letters. Hope thats is the reason having issue. How to make non-case sensitive to access database using hibernate ? or any alternative to use these type of cases. Please advise.
– user2848031
Jan 18 at 19:53
Yes , i noticed error message all small letters but actual table name all capital letters. Hope thats is the reason having issue. How to make non-case sensitive to access database using hibernate ? or any alternative to use these type of cases. Please advise.
– user2848031
Jan 18 at 19:53
1
1
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl adding this to your properties file would override the ImplicitNamingStrategy which Spring auto configuration uses by default. Doing so allows @Table(name = "Student") to map to Student table in your actual database.– 夢のの夢
Jan 18 at 21:08
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl adding this to your properties file would override the ImplicitNamingStrategy which Spring auto configuration uses by default. Doing so allows @Table(name = "Student") to map to Student table in your actual database.– 夢のの夢
Jan 18 at 21:08
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54255231%2fcant-connect-aws-rds-from-local-spring-boot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Kindly provide the
application.propertiesfile. Remember to change/erase the sensitive data.– Pijotrek
Jan 18 at 13:46
Config looks okay. Can you also provide the log? We would like to see the error probably.
– Pijotrek
Jan 18 at 13:58
Updated error message
– user2848031
Jan 18 at 14:16
do you have student table in your db schema
– Sasikumar Murugesan
Jan 18 at 14:17
If I understand the error log correctly, something is wrong with your code/schema. It obtained connection to the DB.
– Pijotrek
Jan 18 at 14:18