Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Neo Say Bin

+ Follow
since May 19, 2008
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Neo Say Bin

Juz checked the certification manager website and got my scores: 353. I did the assignment on Bodgitt and Scraper. I have to say a big thank you to Monkhouse coz his book and his sample application helped me so much to get started on the assignment. As usual, I lost the most marks in the locking section. A breakdown of the marks is as follows:

General Considerations : 90/100
- RMI used with thick clients.
- Facade and adapter pattern used for database. No singleton classes.
- Logging is provided with exception handling.

Documentation : 69/ 70
- Documentation was a bit long but necessary. It is written in text file, with the following major sections:

1. Overview
2. Server Design
3. Client Design
4. Database Access Design
5. Locking Mechanism Design
6. User Interface Design
7. Interface between Presentation Layer and Database Layer
8. Exception Handling Design
9. Logging Design

O-O Design : 30/ 30
- Provided an O-O design, basically following the sample application. Parameters are passed as objects between classes, except when it has to go thru the DBClient interface.

GUI : 40/ 40
- GUI design follows the sample application quite closely.
- Uses Model-View-Controller (MVC) pattern with inner classes.
- Uses ComboBoxModel and AbstractTableModel used for JComboBox and JTable.
- Uses JComboBox for Search Fields.
- Uses Custom JTextField for Customer ID Input to ensure the user only enters the correct length for text input.

Locking : 44/ 80
- Juz used the usual locking mechanism modified from Monkhouse's sample application.
- Followed the locking design that is commonly found in the forum. Did not put too much attention to it as I knew I'm going to lose marks here

Data store : 40/ 40
- Nothing special, modified from the sample application.
- - Data are encoded using ISO-8859-1 due to requirements for 8 bit US ASCII.

Network server : 40/ 40
- Nothing special either, modified from the sample application.

Would like to thank everyone for their help. I would not have done it without the help of this forum.

Thks a lot ^_^

I used the RMI Eclipse plugin to generate the RMI stub and the stub files are found in the "remote" folder.

I'm trying to execute the application using Eclipse 3.3, Java SDK 5, Windows OS, no firewall.

So not too sure why I can't execute the application in the network client mode.

Thks in advice for help rendered
Thks for the replies.

I have a question on

I used the RMI Eclipse Plugin mentioned above to generate the RMI stubs to fulfil the project requirements.

When I tried to run my application in network client mode for the 1st time, the following exception was generated:

WARNING: Connection refused to host: localhost; nested exception is: Connection refused: connect
java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(
/* More description */

Caused by: Connection refused: connect
at Method)
/* More description */

I used the Apress "SCJD Exam With J2SE 5" textbook example as a basis for my application development. When I tried to run the textbook example under network client mode, I get the same exception.

I found some discussions on this topic in the forum:

But I'm not quite sure what it means. Can anyone provide some guidance on this issue?

Thks a lot for the help.
thks for the reminder nearly forgot abt it.

btw, found a useful Eclipse plugin to generate RMI stub:

I'm working on my project using Eclipse 3.3.2, Java 1.4.2. Mu project is based on Java 1.4.

I've been reading the forum pages but I'm still not too sure how to generate the RMI stub. I tried to run "rmic -d <class name>" on the command prompt but it fails. Anyone can provide more detailed instructions?

Sorry abt this question. I'm not too sure abt RMI since I've not had any experience with it.

Thks a lot for the help. Rgds.
Hi all,

Have a question to ask regarding my project. My project uses Hibernate with MySQL. Records are modified and saved/updated via Hibernate. The project does not make direct JDBC calls to MySQL. When I try to save or update an object, Hibernate throws an exception about the duplicate entry. An example of my code to save the object is as follows:

// Code here to open the session and get the object to save or update

// try to save or update the object

// flush the object

Example of the Hibernate mapping of the object:

<class name="ChatSession" table="chat_session">
<id name="id" unsaved-value="0">
<generator class="increment"/>
<set name="participant" cascade="all">
<key column="parent_id"/>
<one-to-many class="Participant"/>
<property name="name" type="string"/>

<class name="Participant" table="participant">
<id name="id" unsaved-value="0">
<generator class="increment"/>
<property name="name"/>

After doing some research, I think my problem is pertaining to the following entry:

However, I'm not sure what the solution is. What do I modify in my application code or hibernate mapping file or settings to resolve this problem?

Thks a lot for the help. Regards.
Hi All,

I got the B&S assignment and I have a question regarding the database file.

My assignment states the following data file format:

Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
2 byte numeric, number of fields in each record

Schema description section.
Repeated for each field in a record:
1 byte numeric, length in bytes of field name
n bytes (defined by previous entry), field name
1 byte numeric, field length in bytes
end of repeating block

Data section.
Repeat to end of file:
1 byte flag. 00 implies valid record, 0xFF implies deleted record
Record containing fields in order specified in schema section, no separators between fields, each field fixed length at maximum specified in schema information

End of file

All numeric values are stored in the header information use the formats of the DataInputStream and DataOutputStream classes. All text values, and all fields (which are text only), contain only 8 bit characters, null terminated if less than the maximum length for the field. The character encoding is 8 bit US ASCII.

When I execute the application, I deduce that:

My database length is size 6093, with header size 55.
Each data record is size 183.

For the last data record stored in the database file, the size is only 182. It seems there is a missing 1 byte flag for my last data record.

Is this normal? How should I handle this last data record that seems to have a missing 1 byte flag?

I'm asking this question as I have problems determining the offset for adding a new record.

Thank you for the help. Regards.