I usually create a resources package within the package of my Java classes
to put the PCML documents in. So, if my package is com.mycompany, I put my
PCML documents in com.mycompany.resources.

I then have a method that looks like this to create the PCML document. It
could probably be abstracted a bit more, but it works.
private ProgramCallDocument createPCMLDoc(String pcmlDocName)
throws PcmlException {
String name = MyClass.class.getPackage().getName() + "/resources";
name += ((pcmlDocName.startsWith("/")) ? pcmlDocName : "/"
+ pcmlDocName);
ProgramCallDocument pcmlDoc = new ProgramCallDocument(system, name);
return pcmlDoc;
}

I don't recall if I've ever done it in a JAR now that I think about it
though. I took a quick glance at the source it looks like, at least in
version 6.6 of JTOpen that it should read documents in you JAR.

Yes, it is preferred to keep your source and classes in separate
directories. Where you store them is up to you, but generally speaking
source should be in a directory named "src" and classes should be in "bin"
for Java SE code and "classes" generally for Java EE.
--
James R. Perkins
http://twitter.com/the_jamezp


On Wed, Nov 4, 2009 at 08:49, Loyd Goodbar <loyd@xxxxxxxxxxxxxx> wrote:

I was doing a comparative study between calling a program from ProgramCall,
ProgramCallDocument, and JDBC. For ProgramCallDocument, the needed PCML
file
resides in the same folder as the .class file.

In Eclipse, how to I add the PCML file as a resource, so it can be bundled
with the class files into an exported JAR? I manually put the file into
folder. But when exporting to a JAR, it is not recognized as a resource.

Also, Eclipse likes to separate source (src folder) from compiled (bin
folder) objects. Is it a good practice to add the bin folder to the package
explorer?

Thanks,
Loyd
--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.