• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Resultset.getdate problem...

 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
reply
    Bookmark Topic Watch Topic
  • New Topic