Zhi Gang

Ranch Hand
+ Follow
since May 03, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Zhi Gang

do any know that whether i can use the java programmer logo in CV?
21 years ago
can anyone let me know whether the scjd is only for 2 years? what should we do after 2 years?
21 years ago
i have uploaded my assignment 19th June and taken the follow up exam 20th June (Friday).
i been waited for approximate 19 days. i had seen ppl in discussion form got result after 10 -15 days. i am a bit nervous now, does it mean that i have high possible of fail my SCJD (thats why they taking so long to mark my assignment) ?
if anyone had submited assignment recently, please let me know how long does it take you result? (might give me a peace of mind)
thanks
Well done you !
May i know how long it is take to get the result? was the result appear in test history?
21 years ago
hi there my JTable is using my own RecordTableModel which is extending the AbstractTableModel. I am trying to re-arrange the column size, so that when it display will be a different length.
ie. Name, Location, size
Name column will be in size 14
Name column will be in size 10
size column will be in size 6
but i am not sure how should i do it, and where .. please let me know if u have any idea..
thanks
the only information that in the instructions
=================================================
The User Interface
The user interface for this assignment must satisfy the following criteria:
It must be composed exclusively with components from the Java Foundation Classes (Swing components).
It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
It must present search results in a JTable.
It must allow the user to book a selected record, updating the database file accordingly.
Your user interface should be designed with the expectation of future functionality enhancements, and it should establish a framework that will support this with minimal disruption to the users when this occurs.
==================================================
the sentances with updating the database file accordingly.. i thought create a new record is updating database as well, isn't?
however i didn't see any information that restrict the client doing updating ...
i really confuse.
please let me know what you think
hi there, iam doing the Contractor V2.1.2 this is the instraction that i have from the db interface.
i just assume that they need a create functional
--------------------------------------------------
// Creates a new record in the database (possibly reusing a
// deleted entry). Inserts the given data, and returns the record
// number of the new record.
public int create(String[] data) throws DuplicateKeyException;
--------------------------------------------------
i have created a JTabbedPanel which consists of JPanel:-
main - the jtable,update,delete, search
create - just for create
1. am i got a wrong version?
please let me know if u have any ideas ...
hi there i have been using JPanel for my create new record screen. I have tested it with different pc. some of the pc work fine, and few pc have squeeze the JTextField to a funny size,
i think might be the display card in the those pc.
if i pretend is ok and submit it. what-if the examiner have a old display card
or
maybe all the sun examiner are loaded should have up to date display card or ....
i am really run out of ideas.. please let me know what u think.. thanks
=========
JPanel namePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
namePanel.setPreferredSize(new Dimension(758, 35));
namePanel.add(new JLabel("Subcontractor Name : "));
newName.setDocument(new LimitedDocument(MAX_NAME));
namePanel.add(newName);
JPanel locPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
locPanel.setPreferredSize(new Dimension(758, 35));
locPanel.add(new JLabel(
"City : "));
newLoc.setDocument(new LimitedDocument(MAX_LOCATION));
locPanel.add(newLoc);
JPanel jobPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
jobPanel.setPreferredSize(new Dimension(758, 35));
jobPanel.add(new JLabel("Type of work performed : "));
newSpecialties.setDocument(new LimitedDocument(MAX_SPECALTIES));
jobPanel.add(newSpecialties);
JPanel sizePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
sizePanel.setPreferredSize(new Dimension(758, 35));
sizePanel.add(new JLabel("No. of staff in organization : "));
newSize.setDocument(new LimitedDocument(MAX_SIZE));
sizePanel.add(newSize);
JPanel ratePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
ratePanel.setPreferredSize(new Dimension(758, 35));
ratePanel.add(new JLabel("Hourly charge : "));
newRate.setDocument(new LimitedDocument(MAX_RATE));
ratePanel.add(newRate);
JPanel submitPanel = new JPanel(new FlowLayout(FlowLayout.
CENTER));
submitPanel.setPreferredSize(new Dimension(758, 35));
submitPanel.add(clearButton);
submitPanel.add(submitButton);
JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.
CENTER));
infoPanel.setPreferredSize(new Dimension(758, 35));
newRecNo.setForeground(Color.red);
infoPanel.add(newRecNo);
hi thanks for reply , please let me know if i am in the right track
=================================================
db.db file location, host and port, then it would be nice to save all that information in the properties file
=================================================
1. java -jar runme.jar alone --> local mode
Using JFileChooser to select the db.db location
and save into suncertify.properties
2. java -jar runme.jar server --> server
get the port,host,db.db location save into suncertify.properties
(is there any API, that i can use for getting a list of port and host?
where is suncertify.properties sit, in the jar or user need to select the file from JFileChooser)
3. java -jar runme.jar -->network client and gui
retrive from suncertify.properties
(do i need to start the server in here/or just assume is started by No.2?)
thanks alot .... much much Appreciated !!!
hi mark
please ignore the above reply
i just read on the reply that u post to Rag Srinivasan ... i guess i need to add some extra functional in GUI to allow user to choose the file part.
Just to confirm, is the file path need to be include in suncertify.properties ?
must is must. Not much for interpretation there.
hi ,
1 .when the assignment mentions database(pls ref. the bold text above), does it mean the location of the db-2x2.db?
2.i am using System.getProperties("user.dir") to determine the working directory so that Data.java will read it from the working directory.
3. if user start the application in workingDirectory(db-2x2.db is in here) with

java -jar app.jar ---> then it will work
but it user start the application
java -jar ../app.jar
or
java -jar /whateverpath/app.jar
then it will fail.. please let me know how should i fix it...
please let me know what u think of the bold text...
thanks ^_^ and good day ...
=================================================
Your choice of RMI or serialized objects will not affect your grade, but no other approach is acceptable. In either case, the program must allow the user to specify the location of the database,and it must also accept an indication that a local database is to be used, in which case, the networking must be bypassed entirely. No authentication is required for database access.
================================================
i have used the System.getProperties("user.dir");
is depend to the user, wherether which working dir they are in. SO am i in the right track??
thanks for reply max.
In page 126 a diagram with a description
"multithreaded DVDDatabase object"
In page 127 a diagram with a description
"Single DVDDatabase object"
it sound like the single DVDDatabase object is much more thread-safe then the multithreaded DVDDatabase object. and i don't undersatnd why it choose to use multithreaded DVDDatabase object.
2. IF i am Using RMI, does it still matter where i use multithreaded DVDDatabase object? RMI will only create one instances anyway? ( i might be dull )
thanks for your help ..
by the way, i love your book ^_^ it helps alot.
Hello, boys and girls .. here is anotehr question from me .. ^_^ thanks in advance.
1.i had read the book The Sun Certified Java developer Exam with J2SE1.4 ISBN:1-59059-030-9
i got really confuse on page no.126 & 127 according to my interpretation - alike the multi-threaded only exsit by using multiple-instances in DVDDatabase object. Does it mean that if i only have a single DVDDatabase object i can not achive multi-threaded? (there are 2 diagrams & pls read the decription)
could some one please explain .
2.i am using RMI for my assignment, and create only one instance of Data object acess by multiple clients does it mean that no multi-threading b'coz i am using single instance of Data??
First of all thanks for your reply.
=================================================
i have provided only one instances of Data sharing across clients. Not all the method in Data are synchronized ie. update,delete,read will be synchronized. And lock and unlock will not be synchronized. (does it mean concurrent requests is provided?)
==================================================
1.really sorry for the confusion. what i am trying to said is i had synchronized update, delete, create lock and unlock, methods that i haven't synchronized are the read and find data, (try to allow "concurrent requests" while other accessing synchronized methods).
the reason that i do it this way is simple b'coz the read and find data will be ok to have multiple access to the ArrayList at the same time.
so, please tell me what do u think.