anyone know about "BroadLeaf", can you help me?
I am using "Broadleaf" framework and convert database from hsql to sql, but I don't how to export database from hsql?
please help me?
You would need to get an external database utility that can connect to an HSQL DB and export the tables you need as SQL Inserts. Once you have the export, you can use native mysql tools to import.
I would recommend DBeaver (https://dbeaver.io/) as the database tool. This article has instructions to export data using DBeaver (https://www.techrepublic.com/blog/linux-and-open-source/two-features-of-dbeaver-that-every-database-manager-should-know/).
I will point out that exporting & importing is only necessary if you have made changes that you would like to keep. If you are using the default demo data, then that data will be loaded into whatever database is being used when the app is started.
Related
My definition of portable is:
When I export my JAVA program to a jar file, others(who use my jar) don't need to install anything except JRE; that is, a portable JAVA SQL package is a jar file and users can use it like a normal package and don't need to install anything else.
Is SQLite for JAVA "portable"? If not, any SQL package is "portable"?
Or there is no such SQL package and users must install some SQL environment?
===========
I think I need a jar file(just a jar package!don't need anything installment!) that accepts SQL statements like creating tables.
My java program is so small so I don't want to install a big big big SQL environment like MySQL.
Just need some basic functions of SQL, like creating tables and querying.
There are some embeded database that can be implemented in the memory.The popular there are :
HSQL,H2 and Derby. (all are similar with mysql)
You can write the "create table.." to build the schema in a sql file, and the app load it and create the database. Of course, you also have to add the sql driver in advance.
But after the app finishes, the data cannot be maintained.
I have collected a source code of a java project from internet where there is a file with .sql extension. I am new to java and don,t know how to work with and get access to .sql file. How can I import the file in Netbeans and how to get access to that database. For your kind information, The project is on inventory management system and I have to get access to that database with a username and password contained inside it. What will I do now? Do I have to install any additional software or something else?
Please give a step by step procedure to do that. Thanks in advance
Doing some simple google searches I found this:
Running a .sql script using MySQL with JDBC
You could do it the way the OP did it, however its not as efficient as the answer. If you close the connection on how the OP did it in that post, and instead of writing the SQL, you can use a filereader to read from the SQL file and then use that data in the execute statement.
The only problem with his method though is that you need to install a JDBC driver.
install a kind of database(such as MySql)
(optional) install a gui tool for your database(such as navicat)
use the .sql files to create tables
install a JDBC driver, which establishes a bridge between your Java code and database
then you can access the database by using JDBC api
I have a java application which uses MySQL as its database. In order to deliver the project, I need to convert it to an executable with MySQL included. I have tried exe4j but it doesn't allow to include the database. Please advice. The project is done in Netbeans.
Although it's not being actively developed any longer due to low demand, you can have a look at the MySQL-Connector/MXJ package that's meant for "embedding" your MySQL-database into your application - I recon' it still should be able to do the trick.
But to be honest, the most future-proof solution would be to switch out your database with another option, preferably an in memory database such as H2database or SQLite.
I'm working on a program and I was wondering how to proceed since I don't want the person
that is going to use it to install any driver or make the odbc step to make the database
functional.
Thanks.
Use HSQLDB, you just need to include the jar in your classpath and you are good to go.
HSQLDB documentation
SQLite saves the database in a compact file format. It's just a library for your program that accesses the database in the file, and requires no setup or installation.
I have prepared an application that is a small demo of Student information manipulation. I have stored information related to students in a MySQL DB. Now my application is working 100% on my computer. But I want that work everywhere without depending on Database! I mean I just want "WHEREVER MY .JAR FILE GOES, DATABASE SHOULD ALSO GO ALONG WITH THAT INSIDE .JAR FILE "
So anyone who is using my application or trying it, they can realize exact result of this application.
How can I make this possible? Please someone help me.
You will probably need to look at something like HyperSQL, which is a in-memory database (which you will need to populate at application start-up). Or have a look at SQLite, which is an embedded databsase, which you can distribute as a resource in your jar.
This doesn't work. MySQL is a full-blown RDBMS. You would have to install it on every computer if you want application to use it locally. An alternative would be using SQLite.
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.
SQLite and Java
SQLite seems to be a good fit for your requirements.