When migrating applications using databases to a cloud platform, consider how to maintain access to the database from the cloud.
The following Java packages indicate use of a database:
java.sqljavax.sqljavax.persistenceorg.apache.ibatisorg.hibernateorg.springframework.daoorg.springframework.jdbcorg.ektorporg.lightcouchorg.jcouchdbcom.buycentives.jrelaxcom.mongodbThis rule flags the following references in the persistence.xml file:
<property name="javax.persistence.jdbc.url"/><jta-data-source>data source name</jta-data-source><non-jta-data-source>data source name</non-jta-data-source>
This rule also flags resource references with a type of
<res-type>javax.sql.DataSource</res-type> element in application.xml,
application-client.xml, ejb-jar.xml, or web.xml files.
Each database Java API type referenced by an application is flagged only once per Eclipse project or Java archive.
For example, if java.sql and javax.persistence APIs are both used in an Eclipse project,
you get two results for that project. The results do not give you an indication of how
many databases are being accessed. Rather, they give an indication of the technologies that you use
to access databases.
All javax.persistence.jdbc.url properties are flagged because
they must be reconfigured when you use a VPN tunnel.
In the following persistence.xml file,
the property element with name="javax.persistence.jdbc.url" is flagged by this rule.
<persistence>
<persistence-unit name="openjpa">
<properties>
...
<property name="javax.persistence.jdbc.url"
value="jdbc:db2://host.ibm.com:50000/mydb2user" />
...
</properties>
</persistence-unit>
</persistence>
If your application is able to directly access the database provider, no further action is required.
Otherwise, you can use a VPN tunnel, such as the IBM Secure Gateway for IBM Cloud, to create a secure connection to your existing on-premises database provider. For more information about configuring a secure connection, see Configuring a VPN. After configuring your gateway, connect your application to the new destination by using the cloud host and port number that is provided when you created the destination. The following URL is an example of an IBM DB2 database URL:
For situations where you want to move your data to the cloud, you can use IBM Cloud databases.