Solved

Inserting data into a remote SQL 2000 database

Posted on 2004-10-27
205 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
Question by:davidnaude
    5 Comments
     
    LVL 12

    Expert Comment

    by:Giant2
    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
    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
    >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:
    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
    Sorry for not help you.
    0

    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