Installing Oracle REST Data Services (ORDS) on Tomcat - java

I have installed JDK and Tomcat 8 on the server. Now I need to install ORDS and connect it to Tomcat. I went through various documentation and downloaded ORDS on the server. Now I have a couple of questions as all this stuff is new to me and documentation is not very clear most of the time.
There is java.exe in the directory to which I installed JDK and there is java.exe in the directory where all the ORDS files are unzipped. Does it matter which one I use to run the installation?
java -jar ords.war standalone --port 8090
Now my second question is do I run standalone ORDS installation and specify port 8090 and then copy ords.war file into Tomcat diirectory Tomcat/webapp and make sure Tomcat is running and it will install ords on its own? That's where I am confused...
My third question is how do I check if ORDS has been installed correctly? Would going to http://localhost:8090/ords suffice?
P.S. Oracle database installed on another server, I have all the passwords, hostname, port, and service name. APEX is also installed on another server.

Appex is the old name for ORDS. After the ORDS version 3.x you don't need to install apex.
ORDS 3.0 is able to deploy WITHOUT Application Express. It has its own database schema now.
Answers for your questions:
It doesn't matter. But make sure it is java 7+. You can instead install java globally and just run: java -jar ords.war command. You can follow this tutorial to install java on your machine: https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html
When you run java -jar ords.war command then at this stage it starts installation of ORDS on your system. Before installation it asks for the oracle server hostname, oracle port, SID, and sysdba username and password to connect. Once you provide all the details and the type of installation you want, then it starts installation to the specific database server. Your tomcat/WLS/glassfish server will act as a rest endpoint between the database server and the clients.
Once installed ORDS on your database, if you right click on your connection in SQL Developer then you can see the Rest Service options. And yes the other way is like you mentioned: http:<host-name>:<port-name>/<schema-alias>/<object-alias>/ and see the result.
If you want to know the detail architecture, I would suggest to follow this oracle document: http://www.oracle.com/technetwork/developer-tools/rest-data-services/overview/index.html
I have recently installed the ORDS in production environment successfully. Actually there are two ways you can install ORDS:
Standalone mode:
Using sql developer you can easily configure the standalone mode: http://www.thatjeffsmith.com/archive/2015/04/deploying-oracle-rest-data-services-from-oracle-sql-developer/
But if you would like to use the terminal you can use the following steps:
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-standalone-mode
Advanced mode:
https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-3-installation-on-tomcat-7.
In the advanced mode ORDS supports Tomcat, WebLogic, and Glassfish application servers
When to use which:
Use Advanced Mode for production
Use Standalone Mode for Development and Testing. You can use Advanced Mode for development and testing but since the standalone mode is quite easy for installation, it is recommended one.
For querying:
http://www.toadworld.com/platforms/oracle/w/wiki/11471.more-oracle-rest-data-services-features
https://svgonugu.com/2015/11/21/adf-bc-rest-services-i/
Note: If your database is PDB you could have some problem installing it and there are some tricks to solve it depending on the problem. Please let me know I would love to answer.

Related

JDBC Connector for MySQL not working in JMeter

As per the problems this person was having;
JDBC Connector not working
I'm running Debian 9.1
I installed Java via the package manager
I added Java to the path in /etc/config & added JAVA_HOME to the path in /etc/environment
I then installed jmeter via the package manager
I then downloaded the mysql-connector-java-5.1.44-bin.jar and copied this to /usr/share/jmeter/lib
But after all this, I still dont get the JDBC connection option under Add->Config Element within JMeter, nor do i get any options for JDBC within JMeter.
Can anyone help me as to what im doing wrong?
While I am new to JMeter, I have successfully run simple "Hello World" HTTP requests queried from a PHP Script & a NodeJS script so far.
Update
Added JMeter log by request
Jmeter log
I have no idea what the problem was with Jmeter on my Debian machine... (as prior to this I was trying to use it on Ubuntu Server, and it had the same issue as Debian);
But anyway, I just installed the Oracle JDK & JMeter for Windows, on my old Windows 7 laptop, dropped in the JDBC connector to the lib directory - & immediately it had the option for 'JDBC Connection', which never appeared on either the Ubuntu or Debian installs.
So if anyone else runs into this issue on Ubuntu or Debian ~ I might suggest trying a Windows 7 VM for running it.
Note here
This was the JMeter I installed on Windows (I didn't get it from Apache):
JMeter for Windows
For some reason I cannot find JMeter JDBC components either in Debian or in Ubuntu repositories, maybe it wasn't included by maintainers.
So instead of installing JMeter using package manager you can just download the latest JMeter version (which is JMeter 3.2 as of now while in repositories you have much older versions, 2.11/2.13) from the official website. JMeter is pure Java-based application so all you will need to do in order to be able to use it is to install Java 8 or above.
Alternative option would be downloading jmeter-jdbc JAR appropriate to your JMeter version and dropping it under /usr/share/jmeter/lib/ext folder (super-user privileges might be required), this way you will get JDBC test elements.

How to embedd sql in Java application?

I have created an application in Java using eclipse and MySQL using Xampp.I have used a connector.jar to link the same.
How can I create an exe that contains the database(without having to install xampp) and run it on a system where there is no java or sql installed?
You can use Excelsior JET compiler.
Also MySQL is not need to install on client, just include connector jar in exe. Client should able to connect server with firewall on necessary port.

Deploying java web apps with databases

I am making java web apps with JSP's and Servlets. I am deploying them on Tomcat7 and using MySql server 5.6. I have made a functioning web app and want to deploy it on a Linux server(a raspberry pi) running tomcat 7. Here is my problem:
I'm developing on windows. Using mysql 5.6 server database, mysql-connector-java-5.1.35 database driver and specific databases on the server. How can I deploy all this on my Linux server server? How do I successfully port a database on my server without any problems?
Thank you for your help!
This is not a problem, install Tomcat7 and MySQL on the Linux server, create a dump from the Windows MySQL server and import it in the Linux MySQL server. The war file with you application can be deployed on the Linux Tomcat7.
What is the requirement to load the DB along with the application ? Ideally your DB should be installed/placed/kept isolated from the application.
Still if you still wanna do this thing then you need a build tool to first zip the database along with the my sql connector. Then when you application gets uploaded onto the server you have to unzip the DB files at some location. You have to hardcode the IP/Hostname (connection related parameters) in you EntityManager(DatabaseConnector file).etc.. etc....
First, make sure you have the same java versions and mysql version installed on your raspberry pi. I use oraclejdk instead of openjdk on my pi as I use the same on my windows. Now create a mysql dump on windows and import it on pi. Now just copy the war to the tomcat and you'll be good to go
Java compiled application code and mysql-connector-java are cross platform, so there shouldn't be any difference in the code or distribution of your Java application.
There are Linux distributions for JDK, Tomcat and MySQL 5.6, but the installation process may vary depending on what Linux distribution you are using. So you should refer to installation instructions:
for JDK 8: http://docs.oracle.com/javase/8/docs/technotes/guides/install/linux_jdk.html
for Apache Tomcat 7: http://tomcat.apache.org/tomcat-7.0-doc/setup.html
for MySQL 5.6: https://dev.mysql.com/doc/refman/5.6/en/linux-installation.html
When you have installed JDK, Tomcat and MySQL 5.6, you will want to transfer the database structure and data from your Windows machine to Linux. You can do this using the mysqldump command which is described here:
https://dev.mysql.com/doc/refman/5.6/en/mysqldump.html
This command is also available for Windows and Linux distribution of MySQL 5.6. So on Windows, to create the dump, you do:
mysqldump -u USERNAME -pPASSWORD DATABASE_NAME > dump.sql
And then on Linux, to import the dump, you do:
mysql -u USERNAME -pPASSWORD DATABASE_NAME < dump.sql

How to install Tomcat on Windows XP?

I'm having trouble installing Tomcat on my windows XP machine. I already have Apache and JDK 6 installed, what I need to know is:
Which file to download from the Lastest Tomcat download page
And how to install it so I can run the sample web app by going to http://localhost/
In my C:\Program Files\Java folder, I see the following folders, this should give you an idea of whether I need any additional stuff installed:
jdk1.6.0_10
jre1.6.0_04
jre1.6.0_06
jre1.6.0_07
jre6
Thanks.
Tomcat 6 doesn't really need the full JDK and it runs with Java 1.5 as well, so Java wise you should be well off. Just make sure that JAVA_HOME environment variable is set.
You can either get the core zip or tar.gz file, or the Windows Service installer file.
Core zip file:
http://www.apache.org/dist/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.zip
Just unzip it and run bin/startup.bat. If you'd like to install it as a Windows service (and get the "usual" program entry in Windows add/remove programs) you can get the Windows Service Installer file instead:
http://www.apache.org/dist/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.exe
By default tomcat listens to port 8080, so to check out the sample apps you need to go to http://localhost:8080/examples/. You can change the default port by editing server.xml in the conf directory.
I'm not sure what that URL is that you provided ("CGI" seems strange from a J2EE site), but the download links for tomcat are on its home page: http://tomcat.apache.org/
You should probably download version 6, particularly if you're using it for personal development. The older versions are available and maintained primarily to support users who don't want to migrate J2EE versions.
Finally: unless you are already using Apache, don't bother with it. Most commercial sites use Apache as a front-end because of its configurability (particularly URL rewriting). If you're just looking to develop web apps, Tomcat will act as web server in addition to servlet/JSP container.
Installation instructions (as well as all other instructions) are here:http://tomcat.apache.org/tomcat-6.0-doc/index.html
If you haven't done any J2EE development before, you'll need some docs on it. The Sun Tutorial is OK, but targeted to the Sun app-server and covers a lot of XML that isn't really necessary. Look at the intro chapters on web apps, then jump to chapter 11: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
From the download page you should download the "Windows Service Installer" package.
As for the rest of the install process, follow just "Step 3: install Tomcat" described in the following page:
http://mircwiki.rsna.org/index.php?title=New_Installation_Instructions
Not a complete answer, but an add-on (how does Stack Overflow handle this?):
For a Windows (XP, Vista, 7) install, you can choose (from the options listed at http://tomcat.apache.org/download-60.cgi):
.zip (pick according to your Windows version)
Windows Service Installer
Now the difference between the top two options:
.zip -- This is a manual install, where you extract the .zip and move it into whatever folder you wish. It does not install Tomcat as a service. It does not "do" anything unless you manually do something with it or have another program use it. It is a manual setup.
Windows Service Installer -- This is a self-installer, just run the .exe. It installs Tomcat as a Windows Service, which if you load up your Windows services (run "services.msc"), you'll see it listed as "Apache Tomcat 6.0 Tomcat6". During the install it will ask you certain setup questions like.
If you choose "Windows Service Installer", here are the default settings the install will ask you:
Type of install: Normal
Server Shutdown Port: 8005
HTTP/1.1 Connector Port: 8080
AJP/1.3 Connector Port: 8009
Windows Service Name: Tomcat6
Create shortcuts for all users: disabled (not that this matters if it's your machine)
Tomcat Administration Login - User Name: blank
Tomcat Administration Login - Password: blank
Tomcat Administration Login - Roles: manager-gui
Path of a Java SE 5.0 or later JRE installed on your system: C:\Program Files\Java\jre7 (if you are running Java SE 7)
Destination (install) folder: C:\Program Files\Apache Software Foundation\Tomcat 6.0
Hope this helps.

run a web project developed in Java run on both windows and Linux platform

I have a web project developed in java. I am using the Windows platform and accessing the project from the Windows machine itself. How can I make the project run on a Linux machine? I am using jboss server and deploying the project.
Regards
Java is Cross-Platform, MySQL also. You can have your application server running on one server and the database on another. You can even have your Appserver on Linux and your database on Windows and your client on MacOS.
If you run into any specific problem, please let us know, but everything should be transparent unless you wrote some very bad Java code ...
Java is a Cross-Platform language. Just deploy your JAR/WAR/EAR in a JBOSS running on a Linux Box.
Java can run on many platforms only if any platform specific coding is not done for example file separator are different in windows, linux and Mac.
You need Jboss for linux and deploy your web application it should just work fine.
Java can run on many plarforms including linux and windows. You can develop project anywhere and run on any server.
I suggest you, install a linux on virtualbox and deploy it on linux directly. Also you can try cruise control for deploy automatically.

Categories

Resources