karl_schweiz
12-07-07, 13:32
Hallo
Kann jemand einem Anfänger helfen?
Habe ein Muster-PGM versucht nachzubauen welches ab eine DTAQ Werte einlesen soll. Der Zugriff auf die DTAQ funktioniert. Jedoch ergibt mir data.getField("PART_NAME") einen Fehler.
Ausgabe in Konsole:
com.ibm.as400.access.ExtendedIllegalArgumentExepti on: name (PART_NAME): Field was not found.
Source:
import java.io.*;
import java.util.*;
import java.net.*;
import com.ibm.as400.access.*;
public class READ_DTAQ {
public static void main(String args[])
{
System.out.println( " " );
{
try
{
AS400 as400 = new AS400("VBZAS400" );
CharacterFieldDescription partname =
new CharacterFieldDescription(new AS400Text(80, as400), "Part_Name");
RecordFormat dataFormat = new RecordFormat();
dataFormat.addFieldDescription(partname);
DataQueue dq = new DataQueue(as400, "/QSYS.LIB/TLSTUD.LIB/STUD_DQ.DTAQ");
boolean Continue = true;
System.out.println("*** Waiting for an entry for process ***");
DataQueueEntry DQData = dq.read(-1);
while (Continue)
{
Record data = dataFormat.getNewRecord(DQData.getData());
System.out.print((String) data.getField("PART_NAME") );
DQData = dq.read(-1);
}
}
catch (Exception e)
{
System.out.println("Data Queue operation failed");
System.out.println(e);
}
}
System.exit(0);
}
}
Kann jemand einem Anfänger helfen?
Habe ein Muster-PGM versucht nachzubauen welches ab eine DTAQ Werte einlesen soll. Der Zugriff auf die DTAQ funktioniert. Jedoch ergibt mir data.getField("PART_NAME") einen Fehler.
Ausgabe in Konsole:
com.ibm.as400.access.ExtendedIllegalArgumentExepti on: name (PART_NAME): Field was not found.
Source:
import java.io.*;
import java.util.*;
import java.net.*;
import com.ibm.as400.access.*;
public class READ_DTAQ {
public static void main(String args[])
{
System.out.println( " " );
{
try
{
AS400 as400 = new AS400("VBZAS400" );
CharacterFieldDescription partname =
new CharacterFieldDescription(new AS400Text(80, as400), "Part_Name");
RecordFormat dataFormat = new RecordFormat();
dataFormat.addFieldDescription(partname);
DataQueue dq = new DataQueue(as400, "/QSYS.LIB/TLSTUD.LIB/STUD_DQ.DTAQ");
boolean Continue = true;
System.out.println("*** Waiting for an entry for process ***");
DataQueueEntry DQData = dq.read(-1);
while (Continue)
{
Record data = dataFormat.getNewRecord(DQData.getData());
System.out.print((String) data.getField("PART_NAME") );
DQData = dq.read(-1);
}
}
catch (Exception e)
{
System.out.println("Data Queue operation failed");
System.out.println(e);
}
}
System.exit(0);
}
}