Inserting data into a remote SQL 2000 database

Posted on 2004-10-27
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.

Question by:davidnaude
    LVL 12

    Expert Comment

    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.

    Hope this could help you.
    Bye Giant.

    Expert Comment

    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.

    LVL 12

    Expert Comment

    >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.

    Accepted Solution

    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.
    LVL 12

    Expert Comment

    Sorry for not help you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Suggested Solutions

    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…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    913 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now