Javatpoint Logo
Javatpoint Logo

GWT Database

In this tutorial, we will setup database connectivity using GWT. We can use Eclipse to configure database.

Eclipse consists of HSQLDB plugin which can be installed. Plugin makes installation easy to set up. Plugin provides many features such as start/stop db, invokes database manager GUI. Here, the following steps are of configuration.

  1. Select Help → Eclipse MarketPlace search keyword HSQLDB and click install button.
  2. GWT Database 1
  3. Now, choose Window → Show View → Others and in Show View dialog expand HSQL Database server and select HSQLDB Server to open the HSQLDB view.
  4. Click on View Menu and select Preferences from the drop down menu. Enter values shown in the Figure.
  5. GWT Database 2
  6. Start the database and open database manager by selecting Show database Client from drop down menu.
GWT Database 3
GWT Database 4

Load Database

We use RStore to load data it has following features:

  1. It enhances java classes for persistence.
  2. It creates database schema.
  3. It deletes database schema.
  4. It persists and retrieves objects from database.

Dependencies

RStore requires HSQLDB, Data Nucleus JDO, MyBatis and Hibernate libraries. Following table lists the dependencies.

Common JDO Hibernate MyBatis
hsqldb-2.2.9.jar jdo-api-3.0.1.jar hibernate-commons-annotations-4.0.1.Final.jar mybatis-3.2.0.jar
commons-lang-2.6.jar datanucleus-api-jdo-3.1.3.jar hibernate-core-4.1.10.Final.jar
log4j-1.2.16.jar datanucleus-core-3.1.4.jar hibernate-jpa-2.0-api-1.0.1.Final.jar
datanucleus-rdbms-3.1.4.jar jboss-logging-3.1.0.GA.jar
datanucleus-enhancer-3.1.1.jar jboss-transaction-api_1.1_spec-1.0.0.Final.jar
asm-4.0.jar antlr-2.7.7.jar
dom4j-1.6.1.jar
javassist-3.15.0-GA.jar

Download: To download above files here are the links:

Common: hsqldb , Common-lang , log4j .

JDO: datanucleus , showfiles , jdo .

Hibernate: hibernate .

MyBatis: mybatis .

Implementation

Adding Mysql configuration to GWT

LoginScreen.gwt.xml

Database Connection

DBConnection.java

DBConnectionAsync.java

User.java (Frontend designing)

MySQLConnection.java (Creating Servlet)

Output

GWT Database 5
Next TopicGWT History





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA