Tag Archives: JDBC

Hibernate Criteria Example


via Hibernate Criteria Example | Examples Java Code Geeks.

Hibernate Criteria is a very good interface offered by Hibernate that helps you write queries with comples search criteteria an keep your code readable and elegant.

So these are the tools we are going to use on a Windows 7 platform:

  • JDK 1.7
  • Maven 3.0.5
  • Hibernate 3.6.3.Final
  • MySQL JDBC driver 5.1.9
  • Eclipse 4.2 Juno

The basis of this tutorials is going to be this Eclipse project: Hibernate1to1XMLExample,zip. And it’s based in Hibernate One-to-One Relationship Example (XML Mapping and Annotation). All the code snippets displayed here reffer to App.java file of the aforementioned project. It’s also a good idea to take a look at Hibernate Query Language Example.

Hibernate Logging Configuration – SLF4J + Log4j and Logback


via Hibernate Logging Configuration – SLF4J + Log4j and Logback | Examples Java Code Geeks.

In this example we are going to see how to configure Logging in Hibernate.SLF4J (Simple Logging Facade for Java) is a very nice logging framwork that Hibernate uses, in order to output your logs using your favorite logging tool ( log4j, JCL, JDK logging, logback) to your preferd location. We are going to use SLF4J along with log4j and Logback.

So these are the tools we are going to use on a Windows 7 platform:

  • JDK 1.7
  • Maven 3.0.5
  • Hibernate 4.2.3.Final
  • MySQL JDBC driver 5.1.9
  • Eclipse 4.3 Kepler

The basis of this tutorials is going to be this Eclipse project: HibernateMySQLExample.zip

Jetty JNDI Example


via Jetty JNDI Example | Examples Java Code Geeks.

The Java Naming and Directory Interface (JNDI) is a Java API for a directory service that allows Java clients to discover and lookup data and objects via name. Data sources, Mail Servers or Messaging queues are among the common objects that can be discovered through JNDI. JNDI lookup strategy abstracts applications from the external resources and makes them more configurable.

In this example, we are going to enable Jetty for JNDI lookups. As in the previous examples, we will start with embedded Jetty and programmatically enable JNDI lookups. We will register a JDBC datasource and demonstrate how we can lookup and access this datasource through JNDI. Thereafter we will see how JNDI resources can be configured in a Standalone Jetty.

Hibernate One-to-Many Relationship Example (XML Mapping and Annotation)


via Hibernate One-to-Many Relationship Example (XML Mapping and Annotation) | Examples Java Code Geeks.

In this example we are going to see how to map classes to databases tables which have one-to-many relationships. We are going to see the mapping both with XML Mapping and with Annotations.

So these are the tools we are going to use on a Windows 7 platform:

  • JDK 1.7
  • Maven 3.0.5
  • Hibernate 3.6.3.Final
  • MySQL JDBC driver 5.1.9
  • Eclipse 4.2 Juno

Hibernate Cascade example


via Hibernate Cascade example | Examples Java Code Geeks.

In this tutorial we are going to see the use of  the cascade feature of relational databases and how it is applied in Hibernate. This tutorial is based on the previous Hibernate One-to-Many Relationship Example (XML Mapping and Annotation). You can download the Eclipse project from there.

So these are the tools we are going to use on a Windows 7 platform:

  • JDK 1.7
  • Maven 3.0.5
  • Hibernate 3.6.3.Final
  • MySQL JDBC driver 5.1.9
  • Eclipse 4.2 Juno

Hibernate JBoss Tools Installation in Eclipse + Mapping Generation Example


via Hibernate JBoss Tools Installation in Eclipse + Mapping Generation Example | Examples Java Code Geeks.

Generating .hbm.cfg files or creating annotated files to map your classes is always a bit boring and it involves writing a lot of boilerplate code. In Eclipse you can use JBoss Hibernatate Tools, with which you can automatically generate all the files you need to work with Hibernate. In this tutorial we are going to see how to install Hibernate Tools in Eclipse and explore how you can generate mapping files automatically.

So these are the tools we are going to use on a Windows 7 platform:

  • JDK 1.7
  • Maven 3.0.5
  • Hibernate 4.2.3.Final
  • MySQL JDBC driver 5.1.9
  • Eclipse 4.3 Kepler

And this is the project I am going to use as the basis for the example : HibernateMySQLExample.zip. Download it and open it with Eclipse IDE.

JDBC Message Store for WSO2 ESB


Introduction Message stores in WSO2 ESB is important in implementing various scenarios like store & forwarding, and reliable delivery. They can be used to persist messages during mediation or even after. Currently synapse uses in-memory message stores, which is incapable of persists after execution. It is also consuming memory too. JMS message stores can save messages, but […]

https://buddhimawijeweera.wordpress.com/2015/06/06/wso2-esb-jdbc-message-store/