Spring Boot: Is it possible to have an h2console connect directly to a MySQL DB?
up vote
-1
down vote
favorite
I am intending to have a console on my web app so I can run queries directly from my browser. I can only find guides on how to connect the h2console to an in-memory DB instance. Is this possible? Security isn't an issue, this is strictly for testing purposes, only my ip address will be allowed to connect to the site (for now).
java mysql spring spring-boot
|
show 2 more comments
up vote
-1
down vote
favorite
I am intending to have a console on my web app so I can run queries directly from my browser. I can only find guides on how to connect the h2console to an in-memory DB instance. Is this possible? Security isn't an issue, this is strictly for testing purposes, only my ip address will be allowed to connect to the site (for now).
java mysql spring spring-boot
If down-voting, please provide feedback as to why. I read stackoverflow.com/questions/45924233/… but I am not going to attempt to try this if it will not work. It may be a dumb question but I am brand new to spring boot (and web dev in general).
– Leo Scarano
Nov 18 at 14:40
I suggest you use PhpMyAdmin to access MySQL. Alternatively you will have to drop relevant JDBC drivers in your classpath and configure to work with H2Console. You might find this answer useful: stackoverflow.com/questions/3217656/…
– JSS
Nov 18 at 14:45
@JSS Is it possible to route a php admin page to apache tomcat? I know I can easily use phpmyadmin but I need to be able to write queries directly on the website.
– Leo Scarano
Nov 18 at 14:57
Not sure what you mean. PHPMyAdmin is written in PHP and can't be natively executed in Tomcat.
– JSS
Nov 18 at 15:13
@JSS I see. I just need a way to execute queries directly on my website while still being able to use spring boot
– Leo Scarano
Nov 18 at 15:15
|
show 2 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I am intending to have a console on my web app so I can run queries directly from my browser. I can only find guides on how to connect the h2console to an in-memory DB instance. Is this possible? Security isn't an issue, this is strictly for testing purposes, only my ip address will be allowed to connect to the site (for now).
java mysql spring spring-boot
I am intending to have a console on my web app so I can run queries directly from my browser. I can only find guides on how to connect the h2console to an in-memory DB instance. Is this possible? Security isn't an issue, this is strictly for testing purposes, only my ip address will be allowed to connect to the site (for now).
java mysql spring spring-boot
java mysql spring spring-boot
asked Nov 18 at 14:21
Leo Scarano
367
367
If down-voting, please provide feedback as to why. I read stackoverflow.com/questions/45924233/… but I am not going to attempt to try this if it will not work. It may be a dumb question but I am brand new to spring boot (and web dev in general).
– Leo Scarano
Nov 18 at 14:40
I suggest you use PhpMyAdmin to access MySQL. Alternatively you will have to drop relevant JDBC drivers in your classpath and configure to work with H2Console. You might find this answer useful: stackoverflow.com/questions/3217656/…
– JSS
Nov 18 at 14:45
@JSS Is it possible to route a php admin page to apache tomcat? I know I can easily use phpmyadmin but I need to be able to write queries directly on the website.
– Leo Scarano
Nov 18 at 14:57
Not sure what you mean. PHPMyAdmin is written in PHP and can't be natively executed in Tomcat.
– JSS
Nov 18 at 15:13
@JSS I see. I just need a way to execute queries directly on my website while still being able to use spring boot
– Leo Scarano
Nov 18 at 15:15
|
show 2 more comments
If down-voting, please provide feedback as to why. I read stackoverflow.com/questions/45924233/… but I am not going to attempt to try this if it will not work. It may be a dumb question but I am brand new to spring boot (and web dev in general).
– Leo Scarano
Nov 18 at 14:40
I suggest you use PhpMyAdmin to access MySQL. Alternatively you will have to drop relevant JDBC drivers in your classpath and configure to work with H2Console. You might find this answer useful: stackoverflow.com/questions/3217656/…
– JSS
Nov 18 at 14:45
@JSS Is it possible to route a php admin page to apache tomcat? I know I can easily use phpmyadmin but I need to be able to write queries directly on the website.
– Leo Scarano
Nov 18 at 14:57
Not sure what you mean. PHPMyAdmin is written in PHP and can't be natively executed in Tomcat.
– JSS
Nov 18 at 15:13
@JSS I see. I just need a way to execute queries directly on my website while still being able to use spring boot
– Leo Scarano
Nov 18 at 15:15
If down-voting, please provide feedback as to why. I read stackoverflow.com/questions/45924233/… but I am not going to attempt to try this if it will not work. It may be a dumb question but I am brand new to spring boot (and web dev in general).
– Leo Scarano
Nov 18 at 14:40
If down-voting, please provide feedback as to why. I read stackoverflow.com/questions/45924233/… but I am not going to attempt to try this if it will not work. It may be a dumb question but I am brand new to spring boot (and web dev in general).
– Leo Scarano
Nov 18 at 14:40
I suggest you use PhpMyAdmin to access MySQL. Alternatively you will have to drop relevant JDBC drivers in your classpath and configure to work with H2Console. You might find this answer useful: stackoverflow.com/questions/3217656/…
– JSS
Nov 18 at 14:45
I suggest you use PhpMyAdmin to access MySQL. Alternatively you will have to drop relevant JDBC drivers in your classpath and configure to work with H2Console. You might find this answer useful: stackoverflow.com/questions/3217656/…
– JSS
Nov 18 at 14:45
@JSS Is it possible to route a php admin page to apache tomcat? I know I can easily use phpmyadmin but I need to be able to write queries directly on the website.
– Leo Scarano
Nov 18 at 14:57
@JSS Is it possible to route a php admin page to apache tomcat? I know I can easily use phpmyadmin but I need to be able to write queries directly on the website.
– Leo Scarano
Nov 18 at 14:57
Not sure what you mean. PHPMyAdmin is written in PHP and can't be natively executed in Tomcat.
– JSS
Nov 18 at 15:13
Not sure what you mean. PHPMyAdmin is written in PHP and can't be natively executed in Tomcat.
– JSS
Nov 18 at 15:13
@JSS I see. I just need a way to execute queries directly on my website while still being able to use spring boot
– Leo Scarano
Nov 18 at 15:15
@JSS I see. I just need a way to execute queries directly on my website while still being able to use spring boot
– Leo Scarano
Nov 18 at 15:15
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
I think you are confusing some things here: h2 is an in-memory-database. There is NO persistent storage. MySQL is a proper RDBMS. I would not expect you to be able to connect to mysql through that interface.
If you just need to be able to execute queries from your web application, and it is not going to go public, simply create a page with a textarea, send that to the backend using JDBC. If I have misunderstood your question, please add additional details to it so we cn provide a better answer.
So use jdbcTemplate.query(<input_string>)? And then just output each line? Is it that simple?
– Leo Scarano
Nov 18 at 19:01
I would think so. i gather thatjdbcTemplate
is your jdbc connection object?
– JoSSte
Nov 18 at 19:03
void query(PreparedStatementCreator psc, RowCallbackHandler rch) Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler. from: docs.spring.io/spring/docs/3.0.x/javadoc-api/org/… looks like it just might be that simple. Thanks for your help!
– Leo Scarano
Nov 18 at 19:11
Great stuff. Don't forget that if you put this into production (serve it up on the web for everyone to see), you need to secure your application properly. Sanitize your inputs, don't allow people to run arbitrary commands, etc.
– JoSSte
Nov 18 at 19:15
Have a few guides bookmarked. Thanks again!
– Leo Scarano
Nov 18 at 20:21
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
I think you are confusing some things here: h2 is an in-memory-database. There is NO persistent storage. MySQL is a proper RDBMS. I would not expect you to be able to connect to mysql through that interface.
If you just need to be able to execute queries from your web application, and it is not going to go public, simply create a page with a textarea, send that to the backend using JDBC. If I have misunderstood your question, please add additional details to it so we cn provide a better answer.
So use jdbcTemplate.query(<input_string>)? And then just output each line? Is it that simple?
– Leo Scarano
Nov 18 at 19:01
I would think so. i gather thatjdbcTemplate
is your jdbc connection object?
– JoSSte
Nov 18 at 19:03
void query(PreparedStatementCreator psc, RowCallbackHandler rch) Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler. from: docs.spring.io/spring/docs/3.0.x/javadoc-api/org/… looks like it just might be that simple. Thanks for your help!
– Leo Scarano
Nov 18 at 19:11
Great stuff. Don't forget that if you put this into production (serve it up on the web for everyone to see), you need to secure your application properly. Sanitize your inputs, don't allow people to run arbitrary commands, etc.
– JoSSte
Nov 18 at 19:15
Have a few guides bookmarked. Thanks again!
– Leo Scarano
Nov 18 at 20:21
add a comment |
up vote
1
down vote
accepted
I think you are confusing some things here: h2 is an in-memory-database. There is NO persistent storage. MySQL is a proper RDBMS. I would not expect you to be able to connect to mysql through that interface.
If you just need to be able to execute queries from your web application, and it is not going to go public, simply create a page with a textarea, send that to the backend using JDBC. If I have misunderstood your question, please add additional details to it so we cn provide a better answer.
So use jdbcTemplate.query(<input_string>)? And then just output each line? Is it that simple?
– Leo Scarano
Nov 18 at 19:01
I would think so. i gather thatjdbcTemplate
is your jdbc connection object?
– JoSSte
Nov 18 at 19:03
void query(PreparedStatementCreator psc, RowCallbackHandler rch) Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler. from: docs.spring.io/spring/docs/3.0.x/javadoc-api/org/… looks like it just might be that simple. Thanks for your help!
– Leo Scarano
Nov 18 at 19:11
Great stuff. Don't forget that if you put this into production (serve it up on the web for everyone to see), you need to secure your application properly. Sanitize your inputs, don't allow people to run arbitrary commands, etc.
– JoSSte
Nov 18 at 19:15
Have a few guides bookmarked. Thanks again!
– Leo Scarano
Nov 18 at 20:21
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
I think you are confusing some things here: h2 is an in-memory-database. There is NO persistent storage. MySQL is a proper RDBMS. I would not expect you to be able to connect to mysql through that interface.
If you just need to be able to execute queries from your web application, and it is not going to go public, simply create a page with a textarea, send that to the backend using JDBC. If I have misunderstood your question, please add additional details to it so we cn provide a better answer.
I think you are confusing some things here: h2 is an in-memory-database. There is NO persistent storage. MySQL is a proper RDBMS. I would not expect you to be able to connect to mysql through that interface.
If you just need to be able to execute queries from your web application, and it is not going to go public, simply create a page with a textarea, send that to the backend using JDBC. If I have misunderstood your question, please add additional details to it so we cn provide a better answer.
answered Nov 18 at 17:28
JoSSte
75711031
75711031
So use jdbcTemplate.query(<input_string>)? And then just output each line? Is it that simple?
– Leo Scarano
Nov 18 at 19:01
I would think so. i gather thatjdbcTemplate
is your jdbc connection object?
– JoSSte
Nov 18 at 19:03
void query(PreparedStatementCreator psc, RowCallbackHandler rch) Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler. from: docs.spring.io/spring/docs/3.0.x/javadoc-api/org/… looks like it just might be that simple. Thanks for your help!
– Leo Scarano
Nov 18 at 19:11
Great stuff. Don't forget that if you put this into production (serve it up on the web for everyone to see), you need to secure your application properly. Sanitize your inputs, don't allow people to run arbitrary commands, etc.
– JoSSte
Nov 18 at 19:15
Have a few guides bookmarked. Thanks again!
– Leo Scarano
Nov 18 at 20:21
add a comment |
So use jdbcTemplate.query(<input_string>)? And then just output each line? Is it that simple?
– Leo Scarano
Nov 18 at 19:01
I would think so. i gather thatjdbcTemplate
is your jdbc connection object?
– JoSSte
Nov 18 at 19:03
void query(PreparedStatementCreator psc, RowCallbackHandler rch) Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler. from: docs.spring.io/spring/docs/3.0.x/javadoc-api/org/… looks like it just might be that simple. Thanks for your help!
– Leo Scarano
Nov 18 at 19:11
Great stuff. Don't forget that if you put this into production (serve it up on the web for everyone to see), you need to secure your application properly. Sanitize your inputs, don't allow people to run arbitrary commands, etc.
– JoSSte
Nov 18 at 19:15
Have a few guides bookmarked. Thanks again!
– Leo Scarano
Nov 18 at 20:21
So use jdbcTemplate.query(<input_string>)? And then just output each line? Is it that simple?
– Leo Scarano
Nov 18 at 19:01
So use jdbcTemplate.query(<input_string>)? And then just output each line? Is it that simple?
– Leo Scarano
Nov 18 at 19:01
I would think so. i gather that
jdbcTemplate
is your jdbc connection object?– JoSSte
Nov 18 at 19:03
I would think so. i gather that
jdbcTemplate
is your jdbc connection object?– JoSSte
Nov 18 at 19:03
void query(PreparedStatementCreator psc, RowCallbackHandler rch) Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler. from: docs.spring.io/spring/docs/3.0.x/javadoc-api/org/… looks like it just might be that simple. Thanks for your help!
– Leo Scarano
Nov 18 at 19:11
void query(PreparedStatementCreator psc, RowCallbackHandler rch) Query using a prepared statement, reading the ResultSet on a per-row basis with a RowCallbackHandler. from: docs.spring.io/spring/docs/3.0.x/javadoc-api/org/… looks like it just might be that simple. Thanks for your help!
– Leo Scarano
Nov 18 at 19:11
Great stuff. Don't forget that if you put this into production (serve it up on the web for everyone to see), you need to secure your application properly. Sanitize your inputs, don't allow people to run arbitrary commands, etc.
– JoSSte
Nov 18 at 19:15
Great stuff. Don't forget that if you put this into production (serve it up on the web for everyone to see), you need to secure your application properly. Sanitize your inputs, don't allow people to run arbitrary commands, etc.
– JoSSte
Nov 18 at 19:15
Have a few guides bookmarked. Thanks again!
– Leo Scarano
Nov 18 at 20:21
Have a few guides bookmarked. Thanks again!
– Leo Scarano
Nov 18 at 20:21
add a comment |
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%2f53361894%2fspring-boot-is-it-possible-to-have-an-h2console-connect-directly-to-a-mysql-db%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
If down-voting, please provide feedback as to why. I read stackoverflow.com/questions/45924233/… but I am not going to attempt to try this if it will not work. It may be a dumb question but I am brand new to spring boot (and web dev in general).
– Leo Scarano
Nov 18 at 14:40
I suggest you use PhpMyAdmin to access MySQL. Alternatively you will have to drop relevant JDBC drivers in your classpath and configure to work with H2Console. You might find this answer useful: stackoverflow.com/questions/3217656/…
– JSS
Nov 18 at 14:45
@JSS Is it possible to route a php admin page to apache tomcat? I know I can easily use phpmyadmin but I need to be able to write queries directly on the website.
– Leo Scarano
Nov 18 at 14:57
Not sure what you mean. PHPMyAdmin is written in PHP and can't be natively executed in Tomcat.
– JSS
Nov 18 at 15:13
@JSS I see. I just need a way to execute queries directly on my website while still being able to use spring boot
– Leo Scarano
Nov 18 at 15:15