Results 1 to 5 of 5
  1. #1
    knightwriter is offline Member
    Join Date
    Nov 2011
    Posts
    49
    Rep Power
    0

    Default Basic Database (Derby) Distribution Question

    I'm working on my java by creating a fictitious company and acting like the programmer for the company. My hr department wants a program to enter employee information and by able to save it to a database. This is the first part of the request. So far I have created a database and gui to interact with the database. Here is what I have when someone clicks on the distributable jar file.
    Basic Database (Derby) Distribution Question-data.png
    I don't know how to get the database into the distribution file. Is it possible to do this? Would I have to create the database on the company network? In either case, I'm not sure how to access the database from the distributable application.

    As an aside, I can access the database with the application while in netbeans ide. Also, if anyone knows how to change the label of the application from "Database Application Example" that would be great. I've ran through the source code and can't find where to change this.

    Thanks in advance for any help.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default Re: Basic Database (Derby) Distribution Question

    Derby/JavaDB can work with databases stored in .jar files but those database are read-only for obvious reasons; better change your application so that it creates the database when it runs for the first time. Given your comment on the frame title I don't think you wrote this code yourself so adjusting the application might be a big task for you ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    knightwriter is offline Member
    Join Date
    Nov 2011
    Posts
    49
    Rep Power
    0

    Default Re: Basic Database (Derby) Distribution Question

    Indeed Jos, I used the design editor in netbeans 7 to create a desktop application that tied into a database that I built ahead of time. Any suggestions on where to research further. I've already looked at the netbeans tutorials and have found how to make the database and how to make the gui to interact with the database, however, I can't find tutorials on how to create a gui + database+ distributable file to make my hr request work.

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default Re: Basic Database (Derby) Distribution Question

    Quote Originally Posted by knightwriter View Post
    Indeed Jos, I used the design editor in netbeans 7 to create a desktop application that tied into a database that I built ahead of time. Any suggestions on where to research further. I've already looked at the netbeans tutorials and have found how to make the database and how to make the gui to interact with the database, however, I can't find tutorials on how to create a gui + database+ distributable file to make my hr request work.
    For the title part: read the API documentation for the JFrame class; that class has a method that can set the title of your frame; somewhere in your (generated) code that method should be called. If you generate your database if it doesn't exist you don't have to ship it with your application; just the derby.jar should be shipped with your application.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,039
    Rep Power
    20

    Default Re: Basic Database (Derby) Distribution Question

    Since this is a db for people in the company to access, a local one doesn't make sense, surely?

    Then again, DB-GUI is already a lot to be learning in one go, so adding Networking-Servers-etc to the mix might be a bit much.

Similar Threads

  1. Database connection with derby on server
    By idbirohit in forum New To Java
    Replies: 0
    Last Post: 09-23-2011, 10:18 AM
  2. Derby database problem
    By rjain in forum New To Java
    Replies: 1
    Last Post: 09-22-2011, 12:36 PM
  3. Basic Database Question
    By nephos in forum New To Java
    Replies: 7
    Last Post: 04-24-2011, 12:08 AM
  4. Deploy derby database
    By Muaz.Sh in forum NetBeans
    Replies: 11
    Last Post: 03-17-2011, 06:02 PM
  5. Using Derby Database in Netbeans
    By DavidG24 in forum New To Java
    Replies: 1
    Last Post: 09-14-2009, 01:29 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
  •