1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

java database on the same directory

Discussion in 'Java' started by badkalel14, Oct 23, 2010.

  1. badkalel14

    badkalel14 New Member

    Joined:
    Jul 26, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    hello guys do you have any idea how to do a program where the database is inside the main project meaning the jar file doesnt rely on a computers database
     
  2. virxen

    virxen New Member

    Joined:
    Nov 24, 2009
    Messages:
    387
    Likes Received:
    90
    Trophy Points:
    0
    you mean something like this?

    Code:
    .........
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String myDB = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:/data/month.MDB";
    DBConn = DriverManager.getConnection(myDB,"","");
    ......
    
     
    badkalel14 likes this.
  3. badkalel14

    badkalel14 New Member

    Joined:
    Jul 26, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    ah! this really answers my question! thank you virxen! thank you man!
     

Share This Page