This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes JDBC start/stop database needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC start/stop database needed" Watch "JDBC start/stop database needed" New topic

JDBC start/stop database needed

James Redpath

Joined: Aug 02, 2003
Posts: 13
Solaris 2.8
Hardware Sun Microsystems
Oracle 8.1.6
Java 1.4
Oracle JDBC
I have a Java application that creates a JDBC connection to Oracle database and queries a table called foo, printing out the values. The table has three columns. I the do the following:
1. I close the resultset and statement, etc. and terminate the program.
2. I go into Oracle sqlplus session and drop the table foo and recreate the data (insert).
3. I re-run the Java application and the resulting query is 0 rows; No errors.
4. I stop and start the Oracle listener and retry the java application with not result.
5. I stop the Oracle listener and shutdown the Oracle database.
6. I startup the Oracle database and Oracle listener.
7. I run the Java application again and it gets the new data.
How to prevent restart of database for change in tables?
Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
LOL - I just did this same thing the other day! It really messed with my head. In SQL Plus, after the insert, do a commit! It doesn't autocommit for you...
James Redpath

Joined: Aug 02, 2003
Posts: 13
Correct that was it. I never disconnected from the database which would provide a commit.
Yanbing Yu

Joined: Aug 31, 2003
Posts: 9
I wanna to see your source code.

java lover
Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
There was no source code, this was a general database question. Read the thread!!!
I agree. Here's the link:
subject: JDBC start/stop database needed
Similar Threads
Netbeans Visual JSF Data Bindings to Table
Design / implementation ideas needed regarding pulling data from external systems
JDBC connection in Oracle Application Server 10g
How to boost performance