Connecting android client with oracle server - java

I need to connect over the internet with the Android client to Oracle PL/SQL database. (With static ip or with the host name).
But already using java client over the year with oracle. And I don't want to go for another database for implementing (Because I already written most complex procedures.,)
And that java client server connection happening via LAN connections only (But the system has the static ip and not used for this. Because LAN communication works perfectly).
Please tell me the process what I have to take.
Note: I am using Oracle 10g (10.2.0.5.0) and Latest Version of java (1.8).
If Possible: Please Provide a link for ojdbc drivers(Don't know which driver version used for Android).
Thanks in advance.

Related

Problem creating new PostgreSQL Data Source in JasperSoft 7.1.1 Appliance

I downloaded the latest Bitnami Jaspersoft (7.1.1) appliance, and when creating a PostgreSQL (JDBC) Data Source to a PostgreSQL via the Jaspersoft web front-end, the "Test Connection" button always fails with an error message "Connection failed". I downloaded the appliance as an OVM, I'm running it as a VirtualBox VM.
To ensure it's not due to networking issues, I installed psql in the appliance (it's a Debian box) to ensure it can actually connect to my PostgreSQL database (it's a separate server), and it connects well via command-line psql, so I assume the problem is a JDBC issue. I also tried opening port-forwarding 5432 via ssh, so that I can connect to my database via localhost.
My question is, how can debug connection problems in Jaspersoft, or identify what is causing the failure? Jaspersoft 7.1.1 appliance comes with MySQL and PostgreSQL JDBC drivers already installed, and I was able to create and successfully test a new Data Source to the local standard MySQL database, so that driver definitely works. I couldn't find any log files that would output any error messages when testing the connection.
The appliance comes with the following JDBC driver: /opt/bitnami/apache-tomcat/lib/postgresql-9.1-903.jdbc4.jar. It also includes the following files:
/opt/bitnami/apps/jasperserver/buildomatic/conf_source/db/postgresql/jdbc/postgresql-9.4-1210.jdbc41.jar
/opt/bitnami/apps/jasperserver/buildomatic/conf_source/db/postgresql/jdbc/postgresql-9.4-1210.jdbc42.jar
/opt/bitnami/apps/jasperserver/buildomatic/conf_source/db/app-srv-jdbc-drivers/postgresql-9.4-1210.jdbc41.jar
/opt/bitnami/apps/jasperserver/buildomatic/conf_source/ieCe/lib/postgresql-9.4-1210.jdbc41.jar
I'm unfamiliar with Tomcat, and although I understand java code, I'm not a full-stack java developer. How can I debug this problem?
After hacking on it for a while, I tried replacing the file /opt/bitnami/apache-tomcat/lib/postgresql-9.1-903.jdbc4.jar with the latest jdbc driver from jdbc.postgresql.org, and restarted the server. This did the trick! I wonder why the latest Jaspersoft Server appliance comes pre-installed with such an old jdbc driver. Also, installing it via the web-based interface as per the documentation didn't work either.
Answering my own question here just in case anyone else gets stuck with the same problem!
Postgresq by default is not allow connection from remote hosts. It possible if you running postgresql and jaspersoft on different hosts.
How to Allow Remote Access to PostgreSQL database

Java: How to connect to mysql and redhsift hosted in AWS?

I am trying to do some automation in mysql and redshift usin Java (JDBC) preferred. I usually use a remote desktop connection to connect, from there I use mysql workbench and aginity workbench to access mysql and redshift repectively. I have authentication for both as well as the aws urls.Also the aginity license. My goal is to connect Java running outside the remote desktop, to query some data fro mthe databases and compare them. I would like to know how to connect to both databases, as well as the documentation where I can learn more. I familiar with all three technologies , I just now sure how to connect them together. I am lost ,kidnle help. Thanks in advance.

Connecting to old Pervasive DB with JDBC

I'm trying to write a small program for CRUD operations against an old Pervasive 9 database, but as soon as I try to get a connection with Drivermanager.getConnection it throws
"java.io.IOException: LNA session closed"
I've read THAT post but copy/paste on that code didn't help me. Could be it configuration on that Pervasive 9 machine? Is it JDBC10 driver that won't play nice with older versions?
Or.. is it me being stupid? (everything is always possible)
Regards
According to Pervasive, using a newer client to an older engine is not recommended. This is documented at http://docs.pervasive.com/products/database/psqlv11/wwhelp/wwhimpl/js/html/wwhelp.htm#href=getstart/installprep.02.6.html#149125.
That doesn't mean it won't work but there's no guarantee. There are reports of the Btrieve interface working properly but the relational (SQL, ODBC, JDBC) side fails more often mainly because it changes between major versions where the Btrieve side stays the same.
I would suggest using the v9 client (and JDBC driver) or upgrading the server to v10.
#elwis your trouble it's the conecction with the database. I recommend you, make a connection using a reverse ssh tunnel against the machine where you have the database first with port by default of pervasive.
Something like: ssh user#yourmachine -L 15831:192.1X.X0.X80:1583
Then, using the tool can generate the connection DBeaver to see and do what you need.
That works for me.
Good luck.

How can I connect oracle database without oracle client?

I want to connect oracle database without oracle client.After searching that how can i do this, figure out I must be use oracle instance client . But how can I use this? Icant find something about that.
The recommended (and most frequently used) JDBC driver for Oracle is the "thin driver". It doesn't need anything installed on the client (and is free).
This FAQ might be useful : http://www.orafaq.com/wiki/JDBC
Oracle client is a software that can easily be found and downloaded from oracle.com website. It has different versions for Windows, Linux, etc. After installing appropriate client, you will be able to communicate with the database by specifying its parameters such as host address, username, password etc. Without it, I think it's not possible to communicate with the database server.
http://www.orafaq.com/wiki/JDBC
On this page it says: "You must use a JDBC OCI driver appropriate to your Oracle client installation." What I understand from here is that you should use JDBC driver in your application, but without client installed, it will be nonsense.

App Java and hosting mysql

I have a Java application and I have to connect to a MySQL DB host in aruba.it. If I make a connection, aruba.it refuses that. How to solve this?
To start, I assume that you're trying to run this Java application locally, or at least at a different machine than where the MySQL DB runs and that you got a SQLException: Connection Refused.
To fix the particular problem, all routers and firewalls in the complete network pipe between the client (where the Java application runs) and the server (where the MySQL DB runs) needs to be configured to allow/forward the port number which the DB uses. This is by default 3306. If this port is blocked, you cannot reach the DB from outside.
Another solution is just to upload the Java application in flavor of a webapplication and run it by HTTP. You'd normally use JSP/Servlet for this.
Apart from network, routers, firewall issues the reason can be that by default remote access to MySQL database server is disabled for security reasons. Mostly DB is hosted on the same server or on the trusted server. If you run java application from your desktop, you need to configure MySQL so it will accept this connections. See this manual for details how to do it.

Categories