Naveen R R

Greenhorn
+ Follow
since May 04, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Naveen R R

Hi,
I want to calculate yesterday's date. Could anyone help me with this?
java.util.Date today = new java.util.Date();
java.text.SimpleDateFormat df = new java.text.SimpleDateFormat("MM/dd/yyyy");
java.util.Date yesterday = (today) - 1; //ERROR
v.addElement(df.format(yesterday));
Thanks,
Naveen
22 years ago
Hi,
Could someone help me with this?
Here is my code:
public class CompanyCodeBean {
private java.lang.String coCode;
private java.lang.String coDescr;
}
public class CostCenterBean {
private CompanyCodeBean company;
------
}
public class TeamBean {
private CostCenterBean costCenter;
----
}
public class DataTable {
private java.util.Vector table;
public Object getRow(int index) {
if (index < 0 | | index > getRowCount()) {
return null;
}
return table.elementAt(index);
}
------
------
}
public class ProjectSaveForm {
public boolean processIncomingRequest
(javax.servlet.http.HttpServletRequest request) {
-----
DataTable teams = ----
------
------
CompanyCodeBean company = new CompanyCodeBean();
CostCenterBean costCenter = new CostCenterBean();
company.setCoCode(((CostCenterBean)teams.getRow
(row)).getCompany().getCoCode());
------
------
I am trying to cast Datatable teams into CostCenterBean. But, it gives java.lang.ClassCastException.
Any ideas?
Thanks,
Naveen
22 years ago
Sum
Hi,
Could anyone help me with this? I am trying to sum the no. of estimated hours for all project phases and display it on the jsp page.
Example:
Phase Est.Hours
------------------
Initiation 5
Analysis 10
Design 15
---------------
Total 30
The phases and hours are retrieved from the database.
But, I am unable to sum it up with the below given code. I think one problem is totEstHours & estHours are strings.

<TD align="center" valign="bottom"><B>Total Hours</B></TD>
<%
beans.project.DataTable prjPhase = projBean.getProjPhase();
String totEstHours = "";
for (int r = 0; r < prjPhase.getRowCount(); r++) {
beans.project.ProjectPhaseBean pBean =
(beans.project.ProjectPhaseBean)prjPhase.getRow(r);
%>
<%
String estHours = "";
if (pBean.getEstimatedHours() != -1) {
estHours = new Integer(pBean.getEstimatedHours()).toString();
}
totEstHours += estHours;
%>
<TD align="center" valign="bottom"><%=totEstHours%></TD>
<% } %>
Thanks,
Naveen
22 years ago
Hi,
We need to extract our Java intranet application's db2 data (only one table) and transfer it to SAP's oracle db. Any ideas as to how to do this? Do we need an interface?
Thank you,
Naveen
22 years ago
Hi,
We need to extract our Java intranet application's db2 data (only one table) and transfer it to SAP's oracle db. Any ideas as to how to do this? Do we need an interface?
Thank you,
Naveen
Hi,
I have a .sql file containing INSERT statements. Could anyone please tell me as to how do I run it in db2 version 7? Also, do I need to add any other statements in the file apart from the INSERT statements (like connect to...)?
Thanks,
Naveen
RamasahayaN@NIBCO.com
Thank you very much. This works fine:
wbImpl = (WorkerBeanImpl)Class.forName(navRow.getWorkerBean()).newInstance();
Naveen
22 years ago
I tried this too:
wbImpl = Class.forName(navRow.getWorkerBean()).newInstance();
Now, it gives the following error:-
Type mismatch: cannot convert from java.lang.Object to navigation.WorkerBeanImpl
Thanks,
Naveen
22 years ago
Hi,
Could anyone help me with this?
It is giving an error:-
Type mismatch: cannot convert from java.lang.Class to navigation.WorkerBeanImpl
public String processRequest(javax.servlet.http.HttpServletRequest request, java.sql.Connection connection) throws Exception {
WorkerBeanImpl wbImpl = null;
try {
for (int row=0; row < wbInfo.getRowCount(); row++) {
NavigationDataRow navRow = wbInfo.getRow(row);
wbImpl = Class.forName(navRow.getWorkerBean()); //ERROR
-------
-------
Thanks,
Naveen
22 years ago
Hi,
Could someone provide me with an example of hashcode()? I need to get the hashcode for each attribute, sum them and rehash them.
And, how does the equals() fit in here?
Thanks,
Naveen
22 years ago
Thanks, k b. It works now.
Naveen
22 years ago
Could anyone please tell me how to correct the following error?
Type mismatch: cannot convert from java.lang.String to security.DeptRoleBean
Code:
public class DeptRoleBean {
private java.lang.String roleId;
----
----
----getter/setter methods----
}
public class OfficeUserBean {
private DeptRoleBean[] deptRole;
-----
----getter/setter methods----
}
public class SecurityTest extends HttpServlet {
private Connection connection = null;
-----
public void performTask(HttpServletRequest req, HttpServletResponse res) {
try {
String roleId = req.getParameter("txtRole_Id");
---------
---------
OfficeUserBean user = new OfficeUserBean();
DeptRoleBean[] deptRole = new DeptRoleBean[5];
deptRole[0] = roleId; //Error
-----
user.setDeptRole(deptRole);
Thanks,
Naveen
22 years ago
Could anyone please help me with this? I get the following error when I try to add an int to a vector.
Error:
The method addElement invoked for type java.util.Vector with arguments () is not defined.
int persNbr = new Integer(roleAssign.getPersNbr()).intValue();
.....
.....
input.addElement(persNbr);//Error
Thank you,
Naveen
22 years ago
Thanks, Andrew. It works now.
Naveen
22 years ago
Thank You.
Naveen
22 years ago