Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
d261a5ec
Commit
d261a5ec
authored
May 18, 1999
by
Peter Mount
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Transactions in ImageViewer
parent
21e03211
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
src/interfaces/jdbc/CHANGELOG
src/interfaces/jdbc/CHANGELOG
+3
-0
src/interfaces/jdbc/example/ImageViewer.java
src/interfaces/jdbc/example/ImageViewer.java
+7
-0
No files found.
src/interfaces/jdbc/CHANGELOG
View file @
d261a5ec
Tue May 18 07:00:00 BST 1999
- Set the ImageViewer application to use transactions
Tue May 18 00:00:00 BST 1999
- Just after committing, I realised why internationalisation isn't
working. This is now fixed (in the Makefile).
...
...
src/interfaces/jdbc/example/ImageViewer.java
View file @
d261a5ec
...
...
@@ -192,6 +192,9 @@ public class ImageViewer implements ItemListener
// Create a statement
stat
=
db
.
createStatement
();
// Set the connection to use transactions
db
.
setAutoCommit
(
false
);
// Also, get the LargeObjectManager for this connection
lom
=
((
postgresql
.
Connection
)
db
).
getLargeObjectAPI
();
...
...
@@ -209,6 +212,7 @@ public class ImageViewer implements ItemListener
try
{
stat
.
executeUpdate
(
"create table images (imgname name,imgoid oid)"
);
label
.
setText
(
"Initialised database"
);
db
.
commit
();
}
catch
(
SQLException
ex
)
{
label
.
setText
(
ex
.
toString
());
}
...
...
@@ -310,6 +314,7 @@ public class ImageViewer implements ItemListener
// our own thread
stat
=
db
.
createStatement
();
stat
.
executeUpdate
(
"insert into images values ('"
+
name
+
"',"
+
oid
+
")"
);
db
.
commit
();
// Finally refresh the names list, and display the current image
ImageViewer
.
this
.
refreshList
();
...
...
@@ -372,9 +377,11 @@ public class ImageViewer implements ItemListener
// Finally delete any entries for that name
stat
.
executeUpdate
(
"delete from images where imgname='"
+
currentImage
+
"'"
);
db
.
commit
();
label
.
setText
(
currentImage
+
" deleted"
);
currentImage
=
null
;
db
.
commit
();
refreshList
();
}
catch
(
SQLException
ex
)
{
label
.
setText
(
ex
.
toString
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment