You are here


HTTPS Connection with Tomcat and WTK emulator

1. Tomcat Configuation

Creating HTTPS Connection

Firstly should create a temporarely SSL certificate to use the
Tomcat in an SSL mode.


MyEclipse+Hibernate-My Exceptions List

Environment: hibernate 2 and Oracle 9i:
This post will record the strange exceptions I have met.

Exception 1:

java.sql.SQLException: ORA-02289: sequence does not exist


Quickly to log your code with log4j in 3 minutes

If you are one lazy programmer like me and have no time to read the document of log4j but still want to use log4j, try to read the following.

At least you'd better know that log4j is one tools to help you debug and log what happened with your code, anywhere and anywhen. I was used to use System.out.println() to debug my code, and I have written one function to do that:


Integrate J2ME Mobile Clients into Web Service 2 -- Create Web Service and J2EE Client

2 Create Web Service

2.1 Create Web Service Project

Enter the %AXIS2_HOME%/samples (Here is D:\ProgramFiles\axis2\samples) , there are many Web Service good example here. If you are not clear about how to create one Web Service from nothing, just like me, those examples are good turorials. Now I will use one and modify it to be our first Web Service.

Integrate J2ME Mobile Clients into Web Service 1 -- Install Web Service

In this post I will build one Web Service with Axis2, and write one J2ME application as one Web Service client. We will know how Web Service works with mobile client.

javax.servlet.ServletException: Unknown initial character set index '48' received from server. Initial client character set can

This week I reinstalled my system, and I found one J2EE Servlet project can not be run after I reinstalled all of the programming softwares and eclipse, this project does connect MySQL database(This project had no problem before). I got this Exception: javax.servlet.ServletException: Unknown initial character set index
'48' received from server. Initial client character set can be forced
via the 'characterEncoding' property.

 Strange, I went to ask my Google friend and I found those information:


MyEclipse+Hibernate 4--Connect to Oracle Database

The connection with Oracle Database has the same step when you connect with MySQL database. The difference lies on the selection of Driver JARs.

In DB Browse, click new icon to create a new connection.

Click Configure database driver:

Add new drivers:


MyEclipse+Hibernate 3--Operatation with database, update records

If you get the data from the same one Session and want to update it right now, just use setXXX() and call session.flush(), and the new data will be inputted into the session. We have used this method in chapter before.

If you has opened one session to get he data from it and then closed the session after finished. How to update the data? Another new seesion should be opened, and call update() to update the database. For example, the first record name is "1", it will be replaced with "lee":

  2. package test;
  3. import java.util.Iterator;
  4. import java.util.List;


MyEclipse+Hibernate 2--Operatation with database, query and list records

Let's go over the project we have done. Open Package Explorer, the class and file structue is like this:

Open User.hbm.xml, this file  is the database mapping file of project, open it.



Subscribe to RSS - J2EE