This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Can anyone throw some light //My program display some silly results. I put the following statement: "SELECT * FROM Reports WHERE DateOfPurch = '"+jtfDate.getText().trim()+"'"; //then tell it to append those results to a text area using the following: int result = new StringBuffer(); ResultSetMetaData metaData = rst.getMetaData(); int numberOfColumns = metaData.getColumnCount(); for(int i = 1; i <= numberOfColumns; i++) result.append(metaData.getColumnName(i)+"\t"); result.append("\n"); while(rst.next()) { for(int i = 1; i <= numberOfColumns; i++) result.append(rst.getObject(i)+"\t"); result.append("\n"); } //but after the third column it starts displaying data in an unordely manner i.e. leaving some unneccessary spaces.
Enock. Unfortunately your question does not deal with Servlets, which is the topic for this forum. I am going to move this to the Java Beginner's forum since you already have posted there, and this question will match the topic there. Please refrain from posting into inappropriate forums. Also to let you know, there is a "CODE" tag that will keep your code formatted with indentation, etc,, that makes your code easier to read and therefore easier for us to help you. The "CODE" tag can be created by clicking on the CODE button below the Add Reply button when posting. Thanks and good luck. Mark