This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Getting 5 instead of 4 Results back (eg) (MySQL) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Getting 5 instead of 4 Results back (eg) (MySQL)" Watch "Getting 5 instead of 4 Results back (eg) (MySQL)" New topic
Author

Getting 5 instead of 4 Results back (eg) (MySQL)

Thomas Beiganz
Greenhorn

Joined: Oct 10, 2012
Posts: 1
Hello all,

I hope this is the right place for my question.

I use a MySQL Database 5.5.22 for a WebApp.



That is my Query and this is my Query String



And the statement works, but I do get a weird output
Item1
Item2
Item3
Item4
[] <---- This is what i meant.

And I don't know from where it comes.



This is the output from MySQL Workbench.

Thanks in advance for you help.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

is id a mandatory column on your database? as it looks like row5 actually exists in the database.

If it isn't add mandatory/ not null to id and see if it will let you.
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3606
    
  60

I would assume the fifth row displayed in MySQL Workbench is simply a placeholder where you can enter values that will become a new row, after you're done editing them.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

Martin Vajsar wrote:I would assume the fifth row displayed in MySQL Workbench is simply a placeholder where you can enter values that will become a new row, after you're done editing them.

I would also assume that, but his result set loop looks correct to me, so just double checking really.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting 5 instead of 4 Results back (eg) (MySQL)
 
Similar Threads
Timestamp assistance
Java won't send SQL query
displaying sql query results
LOAD DATA INFILE problem
LOAD DATA INFILE problem