I want to make my Netbeans project executable with a database without opening any wamp or xampp. I am new at java and I don't know how to do this. Thanks in advance.
            Asked
            
        
        
            Active
            
        
            Viewed 1,578 times
        
    0
            
            
        - 
                    As far as we know wamp and xampp are PHP dev stacks, why are you using them? For MySQL? Could you elaborate your question, bit more. – mane May 25 '15 at 08:46
 - 
                    yes im using it for MySQL. – ian almine May 25 '15 at 08:47
 - 
                    because when i run the jar files i still need to open the xampp to retrieve data in database. – ian almine May 25 '15 at 08:50
 - 
                    I guess, dunni has already pointed out what you should do next. Refer to this SO post -> http://stackoverflow.com/questions/154636/embedding-the-java-h2-database-programmatically . Embedded dbs like H2 are what you are looking for. – mane May 25 '15 at 08:52
 - 
                    do you have any suggestions on how can we embed our database to jar? – ian almine May 25 '15 at 08:59
 
2 Answers
1
            
            
        There are several embedded databases which you can start from your Java application, like H2, HSQLDB, Derby. Try one of them, and if you have a specific problem, ask another question here.
        dunni
        
- 43,386
 - 10
 - 104
 - 99
 
0
            
            
        if you want to use Database as a standalone java application. Then you can go for embedded database. Netbeans comes with default Java DB (derby). 1. Open services tab in Netbeans window -> services 2. Under Databases - Right click -> New connection -> Java DB (Embedded) -> next -> in the JDBC URl give jdbc:derby:myjavadb;create=true -> Click next and finish
- Now you have successfully created Embedded database.
 
Check this link for the code http://www.codejava.net/java-se/jdbc/connect-to-apache-derby-java-db-via-jdbc
        Vidhya - Vidhyadharan
        
- 390
 - 1
 - 5
 - 13