Results 1 to 10 of 10
  1. #1
    AnkleBreaker is offline Member
    Join Date
    Aug 2014
    Posts
    6
    Rep Power
    0

    Default How to add a database to my NetBeans Project when making a setup

    I have completed an assignment for my university in which I had to make a Java NetBeans project. My project is now completed but now I have to make a setup of my NetBeans project and give the university the setup file, only.

    My question is, the software I made has a database attached to it, meaning the purpose of the software is to be used with the database. Values must be saved in the database, deleted from the database etc.. I have used MySQL database connections with the JDBC driver

    I have used exe4j to make the .exe file and Setup Factory to make the exe file and setup file respectively. I used these because they were given by my university. If anyone has a better software they think I should use, please tell. Once I make the setup and run the setup, the application works, ON MY COMPUTER. The computer which made the software. But once I take it to a computer in which MySQL was not installed, the setup installed, but the software did not work.

    I am a beginner to Java so it would be appreciated if the solution were explained as simply as possible.

    PS: I understand that to ask a question in this forum, you need to provide blocks of code or my attempts, but I do not understand what I should attach in this case. So it would be appreciated if this question were not removed. If anything should be attached, please let me know and I would attach it in a jiffy.

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

    Default Re: How to add a database to my NetBeans Project when making a setup

    In this case don't worry about the code.
    The problem lies with the architecture, that is your choice of MySQL.

    Do you have time to switch databases?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,090
    Rep Power
    6

    Default Re: How to add a database to my NetBeans Project when making a setup

    I can rephrase the question to something much shorter.

    "I have an application which depends on a MySQL database. I need an installer generator which can also install a MySQL database on the local client machine and then run database setup scripts. Does anyone know of such an installer generator?"
    Easier said than done. Installing server software such as a database tends to be met with operating system security blocks so you have absolutely no guarantee that it is even going to work. For any future project I would really think about these things BEFORE you start the project as it affects the choice of tooling you will make.

    That's my two cents, I direct you to Tolls for any actual advice ;)
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    AnkleBreaker is offline Member
    Join Date
    Aug 2014
    Posts
    6
    Rep Power
    0

    Default Re: How to add a database to my NetBeans Project when making a setup

    I actually don't. I was reading on some other article which the writer said to use a different database than MySQL. But I am still a first year student and they taught us only MySQL. My assignment is due on Sunday and I have around 50 tables in my database. Isn't there a way to use it with MySQL?

  5. #5
    AnkleBreaker is offline Member
    Join Date
    Aug 2014
    Posts
    6
    Rep Power
    0

    Default Re: How to add a database to my NetBeans Project when making a setup

    Btw I saw a video on embedding databases, but I'm not sure what that means. Will that do the trick?

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

    Default Re: How to add a database to my NetBeans Project when making a setup

    As far as I know, MySQL only has an embeddable C/C++ thing...which will be more effort than a port to Derby (aka JavaDB) and embedding that.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    AnkleBreaker is offline Member
    Join Date
    Aug 2014
    Posts
    6
    Rep Power
    0

    Default Re: How to add a database to my NetBeans Project when making a setup

    So do you know how I can use it to embed my database into the program?

  8. #8
    AnkleBreaker is offline Member
    Join Date
    Aug 2014
    Posts
    6
    Rep Power
    0

    Default Re: How to add a database to my NetBeans Project when making a setup

    I apologize if I am coming off a bit light headed. I'm still a bit of a beginner to Java

  9. #9
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,090
    Rep Power
    6

    Default Re: How to add a database to my NetBeans Project when making a setup

    I was lightheaded too when I broke my ankle. Ugh, I hope it never happens again.

    Are you REALLY sure that the MySQL database needs to be installed too? I would find it far more reasonable if you only had to provide the actual database scripts to generate the database. Let me put it differently: if I were a teacher and I'd give people an assignment to build something that talks to MySQL, my instruction would be: "Make sure the application expects MySQL to run on localhost:3306, username = root, password = root and give me an SQL scripts which creates the tables and data" .

    If I'd give people the task to install MySQL too and I'd have 50 students, I'd end up with 50 copies of MySQL installed!

    My main point being that people tend to misinterpret their assignment instructions.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  10. #10
    AnkleBreaker is offline Member
    Join Date
    Aug 2014
    Posts
    6
    Rep Power
    0

    Default Re: How to add a database to my NetBeans Project when making a setup

    I never thought about it that way, to be honest. My lecturers never told anything about attaching SQL scripts but I can see how that would be done. All we were told is complete the assignment, convert your .jar file to exe and subsequently to a setup application. When the setup is run our software must work.

    If I am to do it your way, MySQL will have to be installed on the client machine when the software is installed, right?

    Are you or anyone here familiar with Setup Factory? I know how to make the .exe file but when making the setup, I don't know how to make the setup install MySQL as well. For example, when you install games, they check if DirectX is installed or not. I want to do the same but with MySQL. Does anyone know? Doesn't necessarily have to be Setup Factory. Any software.

    I hope you understand my English. I'm a bit worried my assignment won't turn out the way I planned and Sunday is coming fast.

Similar Threads

  1. making a setup having a java project in netbeans
    By mukunzi.desire in forum Java Software
    Replies: 1
    Last Post: 12-27-2013, 03:13 PM
  2. Confused about project setup
    By Wnt2bsleepin in forum Android
    Replies: 2
    Last Post: 01-19-2013, 07:49 PM
  3. Making a netbeans project into a executable jar file
    By counterfox in forum New To Java
    Replies: 3
    Last Post: 12-03-2010, 05:09 PM
  4. Replies: 3
    Last Post: 10-21-2010, 09:03 AM
  5. creating setup with database
    By javastuden in forum Advanced Java
    Replies: 4
    Last Post: 11-13-2009, 03:12 PM

Tags for this Thread

Posting Permissions

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