Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: how connection java app to access database that in server

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how connection java app to access database that in server

    hello
    i have access database
    i want the method to create server ?
    and how put this database in the server ?
    and how create connection with java app and this data base


  2. #2
    Junior Member datathinker's Avatar
    Join Date
    Jul 2013
    Location
    Beijing, China
    Posts
    7
    My Mood
    Daring
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how connection java app to access database that in server

    If this is a java application, creating server is not required, what you need to do is to connect ODBC with JDBC to visit MDB file. Code is attached for you.

    String dbDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
    String dbUrl = "jdbcdbc:driver={Microsoft Access Driver (*.mdb)};DBQ=C:/database/t.mdb";
    String dbUser = "sa";
    String dbPassword = "sa";
    Connection connection = null;
    try{
    Class.forName(dbDriver);
    connection = DriverManager.getConnection(dbUrl,dbUser,dbPasswor d);
    } catch (Exception e){
    System.out.println("haha");
    e.printStackTrace();
    }
    ...

  3. #3
    Member
    Join Date
    Jul 2013
    Posts
    219
    Thanks
    0
    Thanked 18 Times in 17 Posts

    Default Re: how connection java app to access database that in server

    Hello.
    Please before posting questions try to ensure the question is correct.
    We never create database servers from java.
    If there is a database server running then we can invoke db operations on the data residing in the db server using Java. For that we will use JDBC.

    Thanks,
    Syed.

Similar Threads

  1. Client-Server Program with MS-Access Database Needed
    By ssdewangare in forum The Cafe
    Replies: 0
    Last Post: April 25th, 2013, 01:32 PM
  2. How to access a database File on remote server
    By sangeetan in forum JDBC & Databases
    Replies: 0
    Last Post: March 19th, 2013, 09:59 AM
  3. connection to a database on another computer(server)
    By myke in forum JDBC & Databases
    Replies: 12
    Last Post: May 31st, 2012, 03:09 AM
  4. MS Access database connection problem
    By faysal40 in forum JDBC & Databases
    Replies: 1
    Last Post: August 29th, 2011, 01:22 AM
  5. Replies: 0
    Last Post: March 26th, 2011, 11:07 AM