Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Connection to server using another jsp page

    Currently, i have hardcoded the server connection in every page and is very tedious if there are any changes to it.

    Therefore, i need to know how to connect to the server by calling up a page that contains the server information.

    The coding i have now is:

    String connectionURL = "jdbc:mysql://servername/databaseName?user=username to enter the server & password=password to enter the server";
    Connection connection = null;
    Statement statement = null;
    ResultSet rs = null;

    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    connection = DriverManager.getConnection(connectionURL, "", "");
    statement = connection.createStatement();



    pls help....

  • #2
    LZS
    LZS is offline
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    jia lac..don't know lei.Hope gt some more ppl visit lo..btw..mayb those ppl in tis website r foreigners in other country which is night time.jia u!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •