Connect to an external (Oracle) database using JDBC - database

I want to use CF as an app container but as CF doesn't provide an Oracle DB service I have to use an external Oracle DB. Can my Java app that runs on CF infrastructure connect to an external Oracle DB that is located on another server using JDBC?
In Google App Engine you can't use JDBC at all.

you should be able to. The only outbound port that is block from CloudFoundry.com I believe, is port 25 (for obvious reasons).

Related

On Amazon SQL Server RDS, how can we identify all apps that are connecting using the direct server name and not the alias?

We are soon to migrate our back-end from an Amazon SQL Server RDS to another identically set up RDS server. We intend that our systems will not be interrupted because they connect using an AWS alias that we will swap to point to the new RDS server.
While we believe all our systems use the alias and not direct server addressing, it is possible that we have missed the change in some application code.
Can anyone advise a method we can use to identify applications that are connecting without the alias?
Is there anything to indicate the connection method from with SQL Server Profiler?
Is it possible to log what applications use the alias from AWS?

Alternative to Azure Key Vault provider in Always Encrypted SQL Server for applications running on Linux

To utilize Always Encrypted feature in SQL Server, impleting Azure Key Vault provider is the most convenient option. However, it has a dependency with the Azure cloud network.
Azure Key Vault cannot be used for on-premise intranet only deployments. When the application is running on Windows Server, any Windows comptibale provider like MSSQL_CERTIFICATE_STORE can be used. But if the application is running on Linux server, there is no provider available.
What is the recommend solution to use a key store provider for Always Encrypted SQL Server on Linux machines?
One possible way is to use ODBC Driver 17 for always encrypted SQL Server running on Linux machine. You can download the driver from here.
This official document will help you to understand all the prerequisites and implementation steps.

Connect to Internal SQL database from Azure Web Application

I'm trying to build a webservice that talks to a SQL database hosted on a server in our internal network. The service is hosted by Azure as a Web App. Is there a good way of doing this? Do I have to use Azure Sql databases, and if I do, is there a way to have the Azure database act as a proxy for our internal database?
There are already rules permitting connections to the ports on our database server, so I don't think that's the problem. I see a lot of questions regarding connecting to Azure hosted sql databases, but nothing about connecting Azure web apps to other kinds of databases.
The error occurs when I try to call a stored procedure (via generated entity framework code) and is as follows:
Error occurred: System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
Our database is configured to allow remote connections, so what I'm guessing the Web App is having difficulty connecting to our vpn.
Please let me know if you need any additional information.
Thanks,
Josh
You can leverage Azure Hybrid Connections which is a feature of App service. Within App Service, Hybrid Connections can be used to access application resources in other networks. It provides access from your app to an application endpoint and uses Azure Relay service to connect to on-premise.
Check out the below link for more details :
https://learn.microsoft.com/en-us/azure/app-service/app-service-hybrid-connections
First option is to look on azure app service hybrid connection but for you to do that you should have Windows server 2012 or above.
Azure App Service Hybrid
Azure App Service hybrid connection is good if you are pulling small amount of data.
If you are pulling large amount of data or your SQL server version is below server 2012 you have two options:
Azure Site to Site VPN
Azure SQL Data Sync
Azure SQL DB Sync is a feature that available on Azure SQL database. You can create a Azure SQL database on azure and sync your on-premise SQL database or SQL database table to Azure SQL database and you can connect your application to Azure SQL database instead of connecting to on-premise database server. This will increase your performance of your application.
We ended up adding the application to an Azure Virtual network that allowed connections to our on-prem servers. The remaining difficulties were due the wrong port numbers being open.
What was very helpful in debugging this was the Kudu console in Azure, under Advanced tools -> console. There you can run commands from the machine hosting your application like ping, or the below:
sqlcmd -S tcp:servername,1433 -U Username -d databasename -P password -q "SELECT * FROM tablename"

AWSGlue: can it connect the SQL Server data stores?

We found in documentation the following:
AWS Glue can connect to the following data stores by using the JDBC protocol:
• Amazon Redshift
• Amazon Relational Database Service (MySQL, PostgreSQL, Aurora, and MariaDB)
• Publicly accessible (Amazon Redshift, MySQL, PostgreSQL, Aurora, and MariaDB) databases
Is it possible to make a JDBC connection with SQL Server for data stores? I'm trying create to Crawler with data store in SQL Server.
Should I create new instance of SQL Server on RDS?
Thanks
It would be possible if the correct JDBC driver was integrated into AWS Glue but it is not. One of the downsides of a serverless environment is you can't add drivers to the server.
AWS reps have informed me that at present, you cannot connect to a database outside an Amazon VPC. This is obviously frustrating. I believe they are putting it on the roadmap.
If you are able to set up an RDS instance with a database they didn't explicitly name, you should try setting up a Glue job to connect to it. If it fails at first because it lacks the nece, I would imagine you should be able to connect to it by supplying the JDBC driver
You can connect to SQL Server using JDBC, here is a article on how to do it.
https://www.progress.com/tutorials/jdbc/accessing-data-using-jdbc-on-aws-glue
Although it's for Salesforce, you can use the similar steps for SQL Server too. Just replace Salesforce JDBC driver with SQL Server JDBC driver.

Can amazon ec2 connect to an external oracle database server?

my project requires me to use PHP and connect to the oracle database service hosted by our department. I want to use amazon ec2 to deploy the project. Is it able to connect to an external oracle database from amazon ec2 by PHP?
I've tried google app engine. It doesn't support external database connection. what a drawback!
Yes, it does. By default, Ec2 instances launched in EC2-Classic have full outbound access. So, the Ec2 instance can connect to your Oracle DB Provided your Oracle DB is accessible over the internet (in other words, your Oracle DB has a public IP address and you have firewall rules configured on your end to allow inbound access to Oracle DB).
If you Oracle DB is in a private network, then you need proxy server or SSH tunnel (or something similar) to connect to the instance.
Overall, there is no limitation on EC2 side.

Resources