+ Reply to Thread
Results 1 to 2 of 2

Thread: Connecting to database through java applet

  1. #1
    krooger is offline x10Hosting Member krooger is an unknown quantity at this point
    Join Date
    Mar 2010
    Posts
    2

    Question Connecting to database through java applet

    Hello, I am confused on how to connect to a database through a java applet hosting on the server.
    Within the applet I would use:
    Code:
    try {
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); //Or any other driver
            }
            catch(Exception x){
                System.out.println( "Unable to load the driver class!");
            }
        
        try{
             Connection dbConnection=DriverManager.getConnection("url","user","password");     <-----------<
            }
            catch( SQLException x ){
                System.out.println(x);
            }
    I assume user and password are just the values for the user I made for my database, but I don't know what to put in the URL parameter.
    If anyone knows how this works the help is greatly appreciated.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Connecting to database through java applet

    Next time, search the forums. This question has been covered in a few different threads (here's another and another) (in short: you can't do that on the free hosts).
    Last edited by misson; 04-15-2010 at 01:50 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. Connecting java to mysql via J/connector and ODBC
    By jpsietsma in forum Programming Help
    Replies: 5
    Last Post: 10-17-2009, 04:32 PM
  2. Java applet embedding?
    By sonicsshadow in forum Free Hosting
    Replies: 0
    Last Post: 01-19-2009, 03:39 PM
  3. Java applet
    By xcaliberse in forum Programming Help
    Replies: 3
    Last Post: 11-16-2008, 03:38 PM
  4. Anfy Java Applet Online problems
    By Tharu in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 08-02-2008, 09:05 PM
  5. connecting to database
    By Daiphron in forum Free Hosting
    Replies: 2
    Last Post: 01-15-2008, 11:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers