File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Resultset.getdate problem... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Resultset.getdate problem..." Watch "Resultset.getdate problem..." New topic
Author

Resultset.getdate problem...

Wayne Burr
Ranch Hand

Joined: Oct 15, 2002
Posts: 38
I'm getting the following error:
C:\KA\ca\com\ka\MetaDataFactory.java:144: cannot resolve symbol
symbol : constructor FactorLME (java.sql.Date,java.sql.Date,java.lang.String,int,java.lang.String)
location: class com.ca.ka.FactorLME
FactorLME factorLME = new FactorLME(rs.getDate(1), rs.getDate(2), rs.getString(3), rs.getInt(4), rs.getString(5));
^
------
.
.
.
private static final String getFactorLMEsSQL;
static
{
sqlBuffer = new StringBuffer();
sqlBuffer.append("SELECT trunc(start_date), trunc(end_date), org_unit, ulae_factor, user_id ");
sqlBuffer.append("FROM kai.factor_lae_monthly_expense a ");
sqlBuffer.append("ORDER BY start_date, end_date");
getFactorLMEsSQL = sqlBuffer.toString();
}

public FactorLMEList getFactorLMEs() throws DataAccessException
{
ArrayList factorLMEs = new ArrayList();
DataConnection dc = null;
PreparedStatement stmt = null;
try
{
dc = dcm.getConnection();
stmt = dc.prepareStatement(getFactorLMEsSQL);
ResultSet rs = stmt.executeQuery();
while (rs.next())
{
FactorLME factorLME = new FactorLME(rs.getDate(1), rs.getDate(2), rs.getString(3), rs.getInt(4), rs.getString(5));
factorLMEs.add(factorLME);
}

rs.close();
stmt.close();
}//~try...

catch (SQLException e)
{
Logger.getInstance().log(e);
//throw new DataAccessException("SQLException: " + e.getMessage() + ": " + e.getSQLState());
throw new DataAccessException("SQLException: " + getFactorLMEsSQL + e.getMessage() + ": " + e.getSQLState());
}

finally
{
dcm.close(stmt);
dcm.close(dc);
}

FactorLMEList factorLMEList = new FactorLMEList(factorLMEs);
return factorLMEList;
}//~..

//end - Factors_LAE_Monthly_Expense
.
.
.
--------------

This Class compliled fine until I added the getDate method in there. I can't seem to find the problem. Any help would be Great!
Thanks!
Wayne Burr
Ranch Hand

Joined: Oct 15, 2002
Posts: 38
Thought this could be helpfull:
-------------------------
package com.ca.ka;
import java.io.*;
public class FactorLME implements Serializable
{
private Date startDate = null;
private Date endDate = null;
private String orgUnit = "";
private double ulaeFactor = 0;
private String factorUserID = "";
public FactorLME()
{
}
FactorLME(Date startDate, Date endDate, String orgUnit, double ulaeFactor)
{
this.startDate = startDate;
this.endDate = endDate;
this.orgUnit = orgUnit;
this.ulaeFactor = ulaeFactor;
//this.userID = userID;
}
public FactorLME(Date startDate, Date endDate, String orgUnit, double ulaeFactor, String factorUserID)
{
this.startDate = startDate;
this.endDate = endDate;
this.orgUnit = orgUnit;
this.ulaeFactor = ulaeFactor;
this.factorUserID = factorUserID;
}
public String getFactorLMEId()
{
return orgUnit;
//WDB - Return what makes up the primary key on the table
}
public Date getstartDate()
{
return startDate;
}
public Date getendDate()
{
return endDate;
}
public String getorgUnit()
{
return orgUnit;
}
public double getulaeFactor()
{
return ulaeFactor;
}
public String getfactorUserID()
{
return factorUserID;
}
}//~public class FactorLME i...
This class complies error free...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Resultset.getdate problem...