I would like to know, is there any possible way to connect to any database during the runtime of a Java Spring Boot application? I am going to use database information from the user (from frontend).
I know something alternatively related to this,
AbstractRoutingDatasource: https://www.baeldung.com/spring-abstract-routing-data-source
Related
I am working on a web application which will serve as an SQL injection learning platform with multiple levels in spring boot and react. I am using PostreSQL as my main database, but I also wanted a lightweight solution for a vulnerable database on which the injections will occure. I was going to choose H2, but it isn't supported on Heroku where I wanted to deploy my application, as I worked with it in the past and it's already familiar.
So the question is: What other platform could I use to work with H2 or should I choose something else instead of H2, and if yes, what?
The way I handle this is to use spring-bean "profiles"
default
or
!default
I use H2 all the time for local-development mode (using 'default' spring bean profile to achieve this).
Now, we do not over-use spring-profiles. We have default and !default. And that is is.
All my JPA stuff works with H2.
There is a monetdb docker deployed on the jupyterhub, I'm developing a Java application which will use the data from the database on the jupyterhub.
Is there a way to write in the code to make the access to the database via internet, so that users can get and write records in runtime?
Thank you!
There is no specific code for that. You can used the JDBC/ODBC libraries to access a remote database.
i want to build a REST API with Java.
I have a MySQL Database and want to use EclipseLink as my JPA Provider.
I want to run it on a Tomcat Server, alternatively i will use another Server if needed.
Now my real question. How do i set all of this up in Eclipse using Maven?
thanks.
Is it possible to authenticate desktop application written in swing using existing spring security configuration (I have all the classes SecurityConfig.java, UserDetailsService.java, SecurityWebAppInitializer.java and they are tested) and it works properly with web application?
I need to authenticate with backend (spring) somehow from the swing application.
I know a way how to achieve something like this using JDBC and fetching the credentials direct from the database.
If it is not possible what else can I do in order to get this done?
Thank you!
I wrote an application which uses a SQLite database, now I want to extend the apllication with a webinterface.
Since I want everything to be in one application with no need to set anything up or install something else I plan to embed Jetty in the application and then install some CGI servlet to use PHP.
The application and the website should be able to modify the database.
This is most likely not to be accomplished with SQLite.
What ideas do you have to accomplish this? Important is that everything can be integrated into one application.
Ensure you access the database only via a javax.sql.DataSource definition from JNDI, and you are golden, as both sides, both the Application and the WebApp will have the same access patterns, techniques, rules, etc ...