Jersey 2.x - Hello, world!

The first tutorial about Jersey: Jersey 1.x - Hello, world! shows the way to develop a simple RESTful Web service application using Jersey 1.19. This tutorial shows you the way to develop the same application using Jersey 2.20. Eclipse for Java EE developers and Apache Tomcat are used to develop the application. If you do not have them, please setup them before continuing this tutorial.

For Ubuntu users:
For any users:
Integrate Tomcat with Eclipse
Read More

Add MySQL JDBC Driver to Eclipse

This tutorial shows you the way to add the latest MySQL JDBC driver to Eclipse. Same steps can be followed to add any other JDBC drivers to Eclipse.

Step 1:
Download and extract the MySQL JDBC connector, from this link: Download Connector/J

Step 2:
Copy the mysql-connector-java-xxx-bin.jar file to any desired folder.

Step 3:
Go to the Window → Preferences in Eclipse.


Read More

JPA - Hello, World! using Hibernate

Java Persistence API (JPA) is a Java application programming interface specification that describes the management of relational data in applications using Java Platform, Standard Edition and Java Platform, Enterprise Edition. Various frameworks like Hibernate, EclipseLink and Apache OpenJPA provide object relational mapping according to JPA standards. This tutorial guides you to develop a simple Java Persistence API (JPA) based database application using Hibernate framework and MySQL database. 
Note: If you prefer Hibernate 5, visit to the new tutorial JPA - Hello, World! using Hibernate 5
You need Eclipse for Java EE developers and MySQL server in your system in-order to try this tutorial.
If you prefer to import the necessary libraries manually as shown in "Step 3 Without Maven", Eclipse for Java developers is enough. Those who prefer Maven projects, need to have M2Eclipse plugin in their Eclipse. This tutorial recommends Eclipse for Java EE, since it has M2Eclipse plugin by default. Also please be informed that the project attached at the end of this tutorial is created using Maven.
Step 1:
Create a database “javahelps” and a table “student” in MySQL.
CREATE DATABASE IF NOT EXISTS javahelps;

CREATE  TABLE javahelps.student ( 
student_id INT NOT NULL ,
student_name VARCHAR(45) NOT NULL ,
student_age INT NOT NULL ,
PRIMARY KEY (student_id) );

Read More

Set Proxy for Maven in Eclipse

If your computer connects with Internet through a proxy server, Maven plugin of Eclipse will not update the project artifacts or Maven plugins. The system proxy settings or proxy settings of Eclipse are not detected by Maven plugin. This tutorial shows you the way to enable proxy for Maven in Eclipse. If you want to configure the proxy for the Apache Maven command line tool, follow the steps 1 and 2 only.

Step 1:
Copy and paste the following content in your favorite editor and save it as settings.xml in the given directory.
<?xml version="1.0" encoding="UTF-8"?>
<settings
 xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
 <pluginGroups/>
 <proxies>
  <!-- Proxy for HTTP -->
  <proxy>
   <id>optional</id>
   <active>true</active>
   <protocol>http</protocol>
   <username>proxyuser</username>
   <password>proxypass</password>
   <host>proxy.host.net</host>
   <port>80</port>
   <nonProxyHosts>local.net</nonProxyHosts>
  </proxy>

  <!-- Proxy for HTTPS -->
  <proxy>
   <id>optional</id>
   <active>true</active>
   <protocol>https</protocol>
   <username>proxyuser</username>
   <password>proxypass</password>
   <host>proxy.host.net</host>
   <port>80</port>
   <nonProxyHosts>local.net</nonProxyHosts>
  </proxy>
 </proxies>

 <servers/>
 <mirrors/>
 <profiles/>
</settings>
Directory for Linux users:
/home/{username}/.m2/
Read More

Install Android Studio in Ubuntu 14.04

Android Studio is the official development tool for Android developers. This tutorial shows you the way to install the latest Android Studio in Ubuntu 14.04. Solutions for some common problems are provided at the end of this tutorial. Android Studio requires Oracle JDK 7.0 or latest in your system. If you do not have JDK, follow this link and install the Java first.


Read More

Contact Form

Name

Email *

Message *