Re: JDBC behaviour
| От | John R Pierce |
|---|---|
| Тема | Re: JDBC behaviour |
| Дата | |
| Msg-id | 56C92E6A.3000209@hogranch.com обсуждение исходный текст |
| Ответ на | Re: JDBC behaviour (Sridhar N Bamandlapally <sridhar.bn1@gmail.com>) |
| Список | pgsql-jdbc |
On 2/20/2016 6:20 PM, Sridhar N Bamandlapally wrote: > from Java/jdbc code, conn.setAutoCommit(false) > > insert into employee values(1, 'K1'); > insert into employee values(1, 'K1'); > insert into employee values(2, 'K2'); > > by looking at exceptions i may rollback or commit, i.e. > conn.rollback() or conn.commit() > if I rollback table should be empty, > if I commit table should have 2 rows > > is there any way is possible ? turn on autocommit if you want each INSERT to be run atomically independent of the other inserts. this is going in circles, we've explained a dozens how postgres and jdbc works. -- john r pierce, recycling bits in santa cruz
В списке pgsql-jdbc по дате отправления: