Here is the main class. I use a "wrapper" class similar to the one you
created to provide access to the UOJ library.
My environments are RHEL 4.5, Fedora 8, Fedora 9 using console, desktop
application, tomcat and glassfish. I use Netbeans as my development
environment.
I hope this helps.
package uojcounter;
import asjava.uniclientlibs.UniDynArray;
import asjava.uniclientlibs.UniString;
import com.ips.controller.unidata;
/**
*
* @author jpowell
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
unidata ud=new
unidata("your_unidata_server","your_ud_account","joe_user","joes_password");
o;?// opens file and keeps reference in a map key=filename, value=unifile
ud.newFile("ORDER.LINE");
// Write a new record
// UniDynArray test=new UniDynArray();
// test.replace(1, 1, "F1.1");
// test.replace(1, 2, "F1.2");
// test.replace(2, "F2");
// test.replace(3, "F3");
// ud.Write("TEST!REC", test, "MTR.IPS");
// read from the file
UniString str=ud.Read("100T0154145!29", "ORDER.LINE");
UniDynArray udr=ud.Read("100T0154145!29", "ORDER.LINE");
System.out.println("UniString: "+str.dcount());
System.out.println("UniDynArray:"+udr.dcount() );
System.out.println("UniString: F136 "+str.dcount(136));
System.out.println("UniDynArray: F1326 "+udr.dcount(136) );
ud.CloseFiles();
ud.disconnect();
// TODO code application logic here
}
}
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/