Change Connection String dynamically from user input using Spring Boot - spring

Requirements -
My Application have multiple clients having their own database servers and database name, but all databases have same structure( as in tables and Keys ) .
I want a plug-in service, where when client login and register its connection string in our local database. Our application fetch the connection String from the database to that particular client and connect to the database and fetch the data from it.
Tried AbstractRoutingDataSource, but it itself needs connection String to be stored before.

Related

If Oracle dblink is set, can the configured external DB also access my DB?

If Oracle dblink is set, can the configured external DB also access my DB?
Is there a way to check which external db is allowed to dblink to my DB?
DB Links are one way: one DB (with the link) is the client and the other DB is the server in the relationship, and the server cannot reach back to the client for data or any other information not normally available from any client (basic connection info is made available by the client through the Oracle Client software API).
There is no server-side privilege that specifies whether a client connection may or may not be from a DB Link or any other specific source: any valid database server account can be used as a link target, just like connecting from any other client. There is a client-side privilege CREATE DATABASE LINK that determines whether the link object can be created on the client side.

Using PrestoDB as RDBMS

I'm currently working on a project connecting prestoDB to our DBtool to extract and load different types of data from different sources(json index from elasticsearch, json record from kafka etc).
it works on a DBeaver with a jdbc, however, our DBtool does not allow the connection without a username and password.
Is there any way to create an user and password in prestoDB that we could use like Oracle or MariaDB account connection

How to connect to an Oracle database with JDBC

I currently have a connection for MySQL database and connected as:
spring.datasource.url = jdbc:mysql://${mysql.service.host}:${mysql.service.port}/${mysql.service.database}
If I were to change the database and used Oracle database instead then how would the datasource URL change?
jdbc:oracle:thin:#//server:port/service
or
jdbc:oracle:thin:#//server:port:SID
The server entry would be the IP address or network name where your Oracle Listener is handling connection requests. The port would be the port number being used for said listener requests.
Service would be the database service name, if you're connecting to an Oracle Pluggable Database, you'll always need this.
The SID is a unique ID for your database, you could use that, but you're encouraged to use the service instead.
If you wish to make a THICK connection, that is, use an Oracle Client to make a connection to your database, then things get a bit more complicated. I would suggest using THIN until you can't.

What is the best way to store database username and password in microservice

While developing microservice (for e.g. spring boot service), we are storing database username and password in properties file. Microservice would connect to database using these database credentials.
Is there any other best way to store database username and password ?
What are best techniques to store database user and password securely in encrypted format and how to decrypt before connecting to database schema?
We are using Chef Cookbook (DevOps), Chef Client for deployment of microservices in Amazon Web Services(AWS)
One possible solution is to have a Config Server to which your applications connect and get their configurations at startup time. This Config Server might decrypt the encrypted sensitive data.
A simple example: https://spring.io/guides/gs/centralized-configuration/

Bidirectional Synchronization between Compact and SQL Server DB in Windows Mobile 6.5

I followed the link http://mobileworld.appamundi.com/blogs/andywigley/archive/2008/12/08/building-a-sync-services-for-ado-net-solution-for-mobile-devices.aspx
and was able to sync DB.
Problem is that it is only for static connection string and Server IP where SQL server DB is located which i provided through designer wizard.
now i want to change the connection string and Server IP as provided in some file.So that user can change the Server DB location and synchronize.I don't know how to proceed.Please Help
In the tutorial the MiddleTierServiceLibrary project has an App.Config file with the DB connection string. You can set the DB connection there.

Resources