Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / February 2005

Tip: Looking for answers? Try searching our database.

java/corba array problem

Thread view: 
mameha - 02 Feb 2005 12:21 GMT
I am trying to set up a very simple client/server system.  The clients
are policemen and the server is a police database with details of criminals.

I want to store the offences by each criminal as an array of strings.
The police can then add extra strings to this array as the criminal
commits offences in the future.

My code is here:
www.dur.ac.uk/z.a.craven/temp/

Can someone please explain why it isn't working?  I think the problem is
with the IDL file where I define the array.
Bjorn Abelli - 02 Feb 2005 15:52 GMT
"mameha" <zaccraven@hotmail.com> wrote...

>I am trying to set up a very simple client/server system.  The clients are
>policemen and the server is a police database with details of criminals.
[quoted text clipped - 7 lines]
>
> Can someone please explain why it isn't working?

"Working" is a relative concept...

My guess is that it didn't even work to generate stubs and skeletons from
the IDL-file with idlj?

>  I think the problem is with the IDL file where I define the array.

CORBA IDL doesn't have this type of fixed arrays (not when I looked at it
last anyway).

To define an array you have to use the type "sequence", as in

  typedef sequence<OffenceRecord> OffenceList;

...and consequently use that as a "listtype", eg in your struct:

struct CriminalObject {
   string name;
   long id_number;
   OffenceList offence_list;
};

This will show up in the generated Java-code as regular arrays.

Just as in Java, the variable doesn't have a length for the array. The
array-instance does.

// Bjorn A
mameha - 02 Feb 2005 18:27 GMT
> "mameha" <zaccraven@hotmail.com> wrote...
>
[quoted text clipped - 38 lines]
>
> // Bjorn A

thank you that is useful.

zac


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.