• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MySQL will only accept the first 256 inserts?

 
Shawn Glisson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am attempting to insert over 2000 rows to MySQL. My code all works correctly but from the 2300 inserts, only the first 256 inserts get saved into my table.
Is this a MySQL issue?
I am testing on WinXP Pro, with MySQL 3.23 using connector-J as the driver.
oh and my table is of type MyISAM.
please help
thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35276
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shawn,
Perhaps the logs are getting full? Try doing a commit after 200 records and then continuing.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I would imagine that possibly you have an auto-incrementing field who's data type is set to a tiny int which only allows a signed range of -128 to 127 and an unsigned range of 0 to 255. Therfor you are only allowing 256 records to be entered into the table.
 
Shawn Glisson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried to committhe inserts and no gold. Also my data types for the table i am inserting to consist of 4 chars and 1 decimal(10,2).
I am not sure what the problems is. Is it possible that an array in java can hold no more than 256 elements?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shawn Glisson:
I have tried to committhe inserts and no gold. Also my data types for the table i am inserting to consist of 4 chars and 1 decimal(10,2).
I am not sure what the problems is. Is it possible that an array in java can hold no more than 256 elements?

1. Do you have an autoincrementing field?
2. What is it's data type?
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you see any error in your log file? Your mysql.log will show the actually sql you are running again. See anything that's out of the ordinary.
If you get an error, please copy and patste to the message.
 
Shawn Glisson
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have determined that the problem is not with the db. From a jsp page I call a static method in a seperate class that receives an integer. The integers value is 2373. Here is the static method...

Now when I use the variable as the index for the arrays I only end up with 256 records instead of the 2373 that I need.
BUT
If I replace the variable with a number like 2000, then I get all 2373 records into the table. Of course they are all the same record but it still goes through the loop the necessary amount of times.
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try closing the statement after you execute the update. Otherwise the statement will not close till the garbage collector collects the object. Which it wont any time soon.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic