[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Inserting data into a remote SQL 2000 database

Posted on 2004-10-27
5
Medium Priority
?
248 Views
Last Modified: 2010-03-31
Hi experts,

I am looking for a good reccomendation here as opposed to an answer.

I need to insert data into a remote SQL server and I am a little unsure of how fast a connection there will be between the application and the SQL server. Is there any sort of reccomended / proven means to insert data in a situation like this where the SQL server is not installed in the local environment.

Thanks
D
0
Comment
Question by:davidnaude
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:Giant2
ID: 12430668
Using JDBC for the programmer is not visible (he/she doesn't care of this) where the Database is.
For increasing speed you can use prepared statement. In this manner the instruction is precompiled. It is good if you are doing many similar query differ only about the data inserted and not with the structure.
So, download and use the JDBC driver for your particular SQLServer and use prepared statement.
http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html
http://www.javaworld.com/javaworld/jw-01-2002/jw-0125-overpower.html

Hope this could help you.
Bye Giant.
0
 

Expert Comment

by:nigelsheldon
ID: 12430741
Absolutely JDBC removes the complexity of connecting to a database, the speed of your query can be optimized in many ways, but the reall problem is the architecture of your application/database.If you are unsure of the type and speed of the connection that your application has to the remote database. And also the security access to the database then you will have to work around it some how.

I'd suggest that you write a servlet that will be running in the same lan/wan space as the database and  have this intermediate layer connect to that database for you. Yes there is more overhead associated with having another layer to your app; but you may not have any luck in convincing a DBA to open up their database for remote access.

If you are not in a secure LAN/WAN network of some sort, I would strongly recommend that you not open up the database for access over the internet.

Nigel
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12430805
>I'd suggest that you write a servlet
In this manner you must have an ApplicationServer/WebServer.
If the program not run on the Internet it's sufficient use the normal and basic JDBC connection.
0
 

Accepted Solution

by:
nigelsheldon earned 800 total points
ID: 12430966
You could possibly increase your connection timeout to cater for a slow network response. Keep in mind that the database may allow only a certain amount of connections at any one point in time which could delay threads from receiving available connections.
0
 
LVL 12

Expert Comment

by:Giant2
ID: 12432852
Sorry for not help you.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question