Friday, October 3, 2008

What Is A Mutual Fund

A mutual fund is an investment vehicle where a person or group of persons, called mutual fund managers, choose a group of stocks and sell them in one package. Mutual funds are generally lower risk investments for a beginner or intermediate investor because: • The managers are experts • Having a large number and variety of stocks is less risky than owning one stock • If the price per share of some stocks go down, others can go up, possibly keeping the price (Net Asset Value), of the mutual fund stable or going up. Mutual funds are also recommended for those who do not have the time, energy or desire to research their own stocks. Every mutual fund and fund family comes with a prospectus-READ the prospectus before investing. The prospectus not only helps you to understand what you are investing in, but it helps you to understand mutual funds and stocks in general. A mutual fund is simply a financial intermediary that allows a group of investors to pool their money together with a predetermined investment objective. The mutual fund will have a fund manager who is responsible for investing the pooled money into specific securities (usually stocks or bonds). When you invest in a mutual fund, you are buying shares (or portions) of the mutual fund and become a shareholder of the fund. Mutual funds are one of the best investments ever created because they are very cost efficient and very easy to invest in (you don't have to figure out which stocks or bonds to buy). If you would like to know the history of mutual funds.Send the queries in the post . By pooling money together in a mutual fund, investors can purchase stocks or bonds with much lower trading costs than if they tried to do it on their own. But the biggest advantage to mutual funds is diversification.

Use of jsp scriptlet to index jsp array variable in struts

For that first we have to declare the array variable in the java form bean with its getters and setters as given below.

int[]chkvalue=new int[20];

public int[] getChkvalue() {

return chkvalue;

}

public void setChkvalue(int[] chkvalue) {

this.chkvalue = chkvalue;

}

Now we can index the element using scriptlet as given below in the jsp page.

Note: Please careful about the quotes

<logic:present name="list">
<logic:iterate id="id" name="list" indexId="ctr">
<html:checkbox name="id" value="" property='<%="chkvalue["+ ctr+"]"%>'>
</html:checkbox>
</logic:iterate>
</logic:present>

Use of logic:iterate within table

Here is the example of the iteration array list element which placed in the arraylist in request scope which is represented in the table format.
<table>

<logic:present name="names">
<logic:iterate id="id" name="names" indexId="ctr">
<TR>
<TD >
<bean:write name="id" property="rollNumber" /></TD>
<TD>
<bean:write name="id" property="studentName" />
</TD>
</tr>
</logic:iterate>
</logic:present>
</table>

Using for loop a method returning arraylist in java struts using jdbc

Here is the sample method is given which is retuning the database values with the arraylist in which the for loop is used to execute the query multiple time.

public ArrayList attToatlAndPresenty(String[] grNumber,String datefrom,String dateto) throws DataAccessException,java.sql.SQLException{

ArrayList list= new ArrayList();

MYSQLConnect connect=new MYSQLConnect();

Connection conn = connect.connection;

Statement smt = conn.createStatement();

ResultSet rs = null;

//write select query for checking password

for(int i=0;i

{

String query="select SUM(attendance) As presenty,count(attendance)as

total,SUM(attendance)/count(attendance)*100 as percentage

from attendance where gr_number='"+grNumber[i]+"' and (Date

between '"+datefrom+"' and '"+dateto+"') order by `date` ";

rs=smt.executeQuery(query);

while(rs.next()== true){

StudentDetailsForm form =new StudentDetailsForm();

form.setPresentdays(rs.getInt("presenty"));

form.setTotaldays(rs.getInt("total"));

form.setAverage(rs.getInt("percentage"));

System.out.println(rs.getInt("percentage"));

list.add(form);

}

}

smt.close();

rs.close();

conn.close();

return list;

}

Inserting database values into the String array in java struts using jdbc

Here is the sample method code is given which is inserting the database values in String array variable.

public String[] findGRNumbers(String branch,String course,String trimester,int size) throws DataAccessException,java.sql.SQLException{

MYSQLConnect connect=new MYSQLConnect();

Connection conn = connect.connection;

Statement smt = conn.createStatement();

ResultSet rs;

int no=0;

String[]str=new String[size];

//write select query for checking password

String query="select gr_number,roll_number,student_name from

student_master where branch='"+branch+"' and

course='"+course+"' and trimester='"+trimester+"'";

rs=smt.executeQuery(query);

while(rs.next()== true){

str[no]=rs.getString("gr_number");

no++;

}

smt.close();

rs.close();

conn.close();

return str;

}

Making a method returning arraylist in java Struts using jdbc

Here is the sample method is given which is retuning the database values with the arraylist.

public ArrayList Dates(String datefrom,String dateto) throws DataAccessException,java.sql.SQLException{

ArrayList list1= new ArrayList();

MYSQLConnect connect=new MYSQLConnect();

Connection conn = connect.connection;

Statement smt = conn.createStatement();

ResultSet rs;

//int no=0;

//String[]str=new String[20];

//write select query for checking password

String query="select DISTINCT `date` from attendance where (Date between

'"+datefrom+"' and '"+dateto+"')";

rs=smt.executeQuery(query);

while(rs.next()== true){

StudentDetailsForm form =new StudentDetailsForm();

form.setDateFrom(rs.getString("date"));

list1.add(form);

}

smt.close();

rs.close();

conn.close();

return list1;

}