0

If I have a method in a Java application for inserting data in to a RDBMS does the method move forward once it has passed the query to the database. i.e will the java application finish the method(connect, run query, close connection) before the RDBMS has processed the query. I want to run some tests but was not sure if the application will finish before the RDBMS and as a result give very little insight into how quickly the database has processed the data?

I guess I could finish each test, with drop table close connection, to ensure that the application has had to wait for the RDBMS to catch up.

Also will using the Eclipse IDE to test RDBMS over different opperating systems affect the performance drastically of the O.S it is running on. (Windows7 Solaris Ubuntu)

Thanks to anyone who makes an attempt to answer.

2 Answers 2

2

Using an IDE won't affect performance - it's just a regular JVM that is started.

As for the other question - unless you are using some asynchronous driver (I don't know if such exist), or starting new threads for each operation, they are synchronous - i.e. the program waits for the database to return result (or to timeout, which should be configurable)

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for that, so the time it takes the method to complete the process is likely to reflect the time in which the RDBMS takes to process the query. Thanks again!
yes. So you can try to parallelize the execution with running multiple threads, but that can be tricky.
Don't forget to take into account any network latency if the database is running on a separate machine -- particularly if the machine is truly remote.
1

Generally, all such calls are synchronous; they block until the operation completes. Unless you are doing something very different.

You may want to look into connection pooling so that you can reuse the connections to avoid creation/destruction costs which can be substantial.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.