Re: MySQL - PreparedStatement problem
Posted by: Jismon Olickal
Date: February 15, 2005 06:23AM

i am using MySql data base and java.

i was trying to execute this statement,
showing an error

public List getPersonalities(int intStart, int intResultsToReturn) throws DAOException
{

Connection conn;
PreparedStatement ps;

try{

ps = conn.prepareStatement("select * from PersonalityType LIMIT ?,? ");
ps.setInt(1, intStartIndex - 1);
ps.setInt(2, intNumberToReturn);
rs = ps.executeQuery();*/

}
}

unable to set values.


if i do like
ps = conn.prepareStatement("select * from Personality where active=1 LIMIT "+intStart+"," +intResultsToReturn);

can anybody solve this problem.

no error.

Options: ReplyQuote


Subject
Written By
Posted
Re: MySQL - PreparedStatement problem
February 15, 2005 06:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.