on 01-05-2008 5:22 AM
Hi Everyone
Im new to this stuff. Im trying through JCO. As far as the single recordsets like data of customer or article are concerned i get it through an array.
But i wanted to retrieve
1- Whole tables like (all articles)
2- Selected articles. or Customer order details (articles in PO)
That means multiple records in one go.
Later on ill display it in JTables.
Like for the past three days i was googling around. Thought like this ones not for my stomach. Came across this Forum. Thought its worth posting a request.
Here is the code
-
public String[] KSearch(String Knr) throws Exception{
String[] Result=new String[11];
IFunctionTemplate ftemplate= Con.repository.getFunctionTemplate("SucheKUNDE");
if (ftemplate == null)
throw new Exception("Funktionstemplate nicht gefunden");
JCO.Function function = ftemplate.getFunction();
JCO.ParameterList input = function.getImportParameterList();
input.setValue(Knr,"FieldName");
JCO.Client client = JCO.getClient(Con.conPoolId);
client.execute(function);
JCO.ParameterList output = function.getExportParameterList();
Result[0]=output.getString("NAME");
Result[1]=output.getString("VORNAME");
Result[2]=output.getString("GDATE");
Result[3]=output.getString("TELEFON");
Result[4]=output.getString("MAIL");
Result[5]=output.getString("STRASSE");
Result[6]=output.getString("PLZ");
Result[7]=output.getString("ORT");
Result[8]=output.getString("KONTO");
Result[9]=output.getString("INSTITUT");
Result[10]=output.getString("BLZ");
JCO.releaseClient(client);
return Result;
}
-
now instead of a single record what if im expecting a number of records, like what if i need customer over 25. Which means more than one. I have to get in tabular format so that i can display it in JTables.
Hope it a bit illustrative.
Regards
Edited by: Aaron Maleck on Jan 5, 2008 7:35 AM
public String[] KSearch(String Knr) throws Exception{
String[] Result=new String11;
IFunctionTemplate ftemplate= Con.repository.getFunctionTemplate("SucheKUNDE");
if (ftemplate == null)
throw new Exception("Funktionstemplate nicht gefunden");
JCO.Function function = ftemplate.getFunction();
JCO.ParameterList input = function.getImportParameterList();
input.setValue(Knr,"FieldName");
JCO.Client client = JCO.getClient(Con.conPoolId);
client.execute(function);
-
// Maybe here you should use a JCO.Table Class to get the //ExportParameters such as
JCO.Table output = function.getTableParameterList().getTable( "tabelname" );
// so you can use setRow() Function to get the information of the //relevant record. such as the 3. Costum
output.setRow(3);// Record Number
Result[0]=output.getString("NAME");
Result[1]=output.getString("VORNAME");
Result[2]=output.getString("GDATE");
Result[3]=output.getString("TELEFON");
Result[4]=output.getString("MAIL");
Result[5]=output.getString("STRASSE");
Result[6]=output.getString("PLZ");
Result[7]=output.getString("ORT");
Result[8]=output.getString("KONTO");
Result[9]=output.getString("INSTITUT");
Result10=output.getString("BLZ");
-
JCO.releaseClient(client);
return Result;
}
Iam not sure that works. But you can try it. and reply me to tell if it really works as i think.
Hope helps.
Amao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.