tumblr counter

H2 In-Memory Database Example

H2 In-Memory Database Example

In this H2 In-Memory Database Example, we are going to store the database contents on In-Memory of the system. Here persistence happens on Memory of the system. In this example we are creating a java class that shows how to load the driver, create a database, create table and insert some values into table

H2 is an open source software implementation of Java SQL database. The main features of H2 are.

  • Very fast, open source, JDBC API
  • Embedded and server modes; in-memory databases
  • Browser based Console application
  • Small footprint: around 1.5 MB jar file size

Reference -> http://www.h2database.com/html/main.html

H2 File Database Example

H2 File Database Example

In this H2 File Database Example, we are going to store the data in file system. Here persistence happens on file system. In this example we are creating a java class that shows how to load the driver, create a database, create table and insert some values into table

H2 is an open source software implementation of Java SQL database. The main features of H2 are.

  • Very fast, open source, JDBC API
  • Embedded and server modes; in-memory databases
  • Browser based Console application
  • Small footprint: around 1.5 MB jar file size

Reference -> http://www.h2database.com/html/main.html

H2 Database Example

H2 Database Example

In this H2 Database Example, we are going to create a simple class that shows how to load the driver, create a database, create table and insert some values into table

H2 is an open source software implementation of Java SQL database. As due to Embedded database it is not used for production deployment, but mostly used for development & testing

The main features of H2 are.

  • Very fast, open source, JDBC API
  • Embedded and server modes; in-memory databases
  • Browser based Console application
  • Small footprint: around 1.5 MB jar file size

Reference -> http://www.h2database.com/html/main.html

Apache CXF And Embedded Tomcat

Apache CXF And Embedded Tomcat

In this tutorial we are going to test a webservice using embedded Tomcat instance and JUnit. Here we are testing a simple REST service implemented by CXF framework, It works as a standalone application.

Apache CXF And Embedded Tomcat

Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.

Reference -> http://tomcat.apache.org/

CXF Webservice Using Embedded Jetty

CXF Webservice Using Embedded Jetty

In this tutorial we are going to test a webservice using embedded Jetty instance and JUnit. Here we are testing a simple REST service implemented by CXF framework, It works as a standalone application.

CXF Webservice Using embedded Jetty

Jetty provides a Web server and javax.servlet container, plus support for SPDY, WebSocket, OSGi, JMX, JNDI, JAAS and many other integrations. These components are open source and available for commercial use and distribution

Reference -> http://www.eclipse.org/jetty/

Add HTTP Headers To SOAP Request Using CXF

Add HTTP Headers To SOAP Request Using CXF

Add HTTP Headers to a SOAP Request Using CXF explains about step by step details of setting custom http headers to a SOAP Request and retrieve the headers in server side by using CXF.

Message message = PhaseInterceptorChain.getCurrentMessage();
SoapMessage soapMessage = (SoapMessage) message;
List list = soapMessage.getHeaders(); 
for (Header header : list) { 
  System.out.println("Country: "+((Element)header.getObject()).getTextContent()); 
}

On above code, we are getting list of header from SoapMessage

CXF WS-Discovery Example

CXF WS-Discovery Example

CXF WS-Discovery Example explain about configuring WS-Discovery service with Apache CXF.

Web Services Dynamic Discovery (WS-Discovery) is a protocol, which enable dynamic discovery of services available on the local network. By default, WS-Discovery uses a UDP based multicast transport to announce new services

Apache CXF  is a free and open source project, and a fully featured Webservice framework. It helps you building webservices using different front-end API's, like as JAX-RS and JAX-WS.

WS-Discovery is available from Apache CXF 2.7.x onwards.

Reference-> http://cxf.apache.org/docs/ws-discovery.htm

CXF WS-Discovery Client

CXF WS-Discovery Client

CXF WS-Discovery Client explains step by step details of discovering a JAX-WS service using CXF WS-Discovery feature

For Creating Apache CXF WS-Discovery Client, We are using org.apache.cxf.ws.discovery.WSDiscoveryClient. WSDiscoveryClient is an in built CXF class

Which helps us to search the services on the network and invoke the operation on that available service.