aspose file tools*
The moose likes JDBC and the fly likes problem in insert mulpitle rows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "problem in insert mulpitle rows" Watch "problem in insert mulpitle rows" New topic
Author

problem in insert mulpitle rows

chain singh
Ranch Hand

Joined: Feb 28, 2012
Posts: 117
Hello

i am inserting multiple row in sqlserver. this query return in a text file
i have to separately insert each row so i have to tokenize the data from query

please help me to tokenize the query which is following

insert into Employee values
('chain','singh','bika.gmailll'),
('chain','singh','bikaccccc.gmailll');


and i wanted by code to make

insert into Employee values ('chain','singh','bika.gmailll')
insert into Employee values ('chain','singh','bikaccccc.gmailll')
Eduardo Moranchel
Greenhorn

Joined: Jul 31, 2012
Posts: 5
actually you only need a lot of string parsing.
But here it is how you usually do this:


is not the best code (i know) but should point you in the right direction
Also where the system.out.println is is where you need yo add the string to a collection to return it or call directly the insert in the jdbc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in insert mulpitle rows
 
Similar Threads
Fetching data using jdbc....query doubt
Updateable ResultSet just for doing inserts: good idea?
problem in migrationg from jboss EAP 5 to jboss AS 5
Data truncation: Truncated incorrect DOUBLE value:
How to pass arrays using JDBC to database?