Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Constructor problem

843789Oct 10 2009 — edited Oct 11 2009
I'm getting the following error message...

C:\Java\Class_Library\AS400Connect.java:75: cannot find symbol
symbol : constructor AS400Connect(com.ibm.as400.access.AS400,java.lang.String,java.lang.String)
location: class AS400Connect
AS400Connect AS400 = new AS400Connect(connect, "dbillings1", "JR12A");
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.*;*
*import com.ibm.as400.access.AS400File;*
*import java.util.*;
import java.math.*;*
*import java.io.*;
import java.beans.PropertyVetoException;

public class AS400Connect
{
	public String model;
	public String desc;
	public String pcfg;
	public boolean cutout;
	public int layer;
	public int height;
	public String special;
	public String comments;

	public AS400Connect(AS400 server, String library, String file, String model)
	{

		server.connectService(AS400.RECORDACCESS);

		AS400FileRecordDescription recordDescription = new AS400FileRecordDescription(
		server, "/QSYS.LIB/"+library+".LIB/"+file+".FILE");

		RecordFormat logFormat = null;
		logFormat = recordDescription.retrieveRecordFormat()[0];

		KeyedFile file400 = new KeyedFile(server, recordDescription.getPath());
		file400.setRecordFormat(logFormat);
		file400.open(AS400File.READ_WRITE, 0, AS400File.COMMIT_LOCK_LEVEL_NONE);

		Record data = null;
		Object[] key = new Object[1];
		key[0] = model;

		data = file400.read(key);

		int counter = 0;
		while (data != null) {
			++counter;

		    this.model = data.getField("MODEL").toString().trim();
		    this.pcfg = data.getField("PCFG").toString().trim();
		    this.desc = data.getField("DESC").toString().trim();

		    data = file400.readNextEqual(key);
		    if (counter >= 100) {
				data = null;
			}
		}

		file.close();
		system.disconnectAllServices();
		System.exit(0);
	}


	public static void main(String[] args) throws AS400SecurityException,
		            IOException, AS400Exception, InterruptedException,
		            PropertyVetoException
	{
		AS400 connect = new AS400("MY_SERVER", "MY_USER", "MY_PASS");
/*75 ---->*/	AS400Connect AS400 = new AS400Connect(connect, "dbillings1", "JR12A");
		AS400.printValues();
	}


    public String printValues()
    {
		System.out.print(this.model);
		System.out.print(this.pcfg);
		System.out.print(this.desc);
	}
{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2009
Added on Oct 10 2009
3 comments
270 views