This content has been marked as final. Show 5 replies
1. What are you expecting by putting this in a loop?
pstmt.setString(2, s2[ i ]); You'll have to execute an insert for each item, it won't work by magic like this.
2. Do some simple debugging. Make your code tell you if it's even getting to that code at all.
3. Where's your catch statement? Are you completely ignoring a possible exception?
Thanks for ur reply
Here im giving the complete code
String driver = "org.gjt.mm.mysql.Driver";
String sql="INSERT INTO my_det(name,person) VALUES(?,?)";
for (int i = 0; i < s2.length; i++)
Message was edited by:
One question (#3) of mine answered, only two more to go...
I tried this also pstmt.setString(2, s2[ i ]); but its not working
If "not working" means it only writes one record, then yes, that's what your program does. If it means something else, then what?