Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

run query in the same time  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..

i have a question..

is it possible to run query insert, update, delete in the same time in java?

if its possible could you please give me the example..

thanks & regards
 
Sheriff
Posts: 22972
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "in the same time" mean?
 
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean as a single update, yes, you can chain them together in a single string if your driver supports batch queries. Although usually when you perform a batch operating all the queries are the same type. Having a batch operation of multiple different type (Select, insert, update) would create output akin to apples and oranges, as in its hard for the driver to know what to return. A lot of times it might just return the information from the last operation, so hopefully that's where you put the select.
 
Yudi Ono
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Paul, i want to perform batch operating all query(insert, delete, update) in to one transaction, the purpose is to identified which query is fall and when it's fall i just have to rollback the transaction.

@Scott

Having a batch operation of multiple different type (Select, insert, update) would create output akin to apples and oranges , as in its hard for the driver to know what to return



hi scott is it possible to change the multiple different type query and turn it into atomic query and hold them in one transaction and it also check if one query fall, it will return error, and automatically the rollback transaction run?
 
Yudi Ono
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yudi Ono wrote:hi..

i have a question..

is it possible to run query insert, update, delete at the same time in java?

if its possible could you please give me the example..

thanks & regards

 
Yudi Ono
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yudi Ono wrote:hi..

i have a question..

is it possible to run query insert, update, delete at the same time in java?

if its possible could you please give me the example..

thanks & regards

 
Yudi Ono
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Yudi Ono wrote:hi..

i have a question..

is it possible to run query insert, update, delete at the same time in java?

if its possible could you please give me the example..

thanks & regards

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!