Package org.h2.samples
Class Compact
- java.lang.Object
-
- org.h2.samples.Compact
-
public class Compact extends java.lang.ObjectThis sample application shows how to compact the database files. This is done by creating a SQL script, and then re-creating the database using this script.
-
-
Constructor Summary
Constructors Constructor Description Compact()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcompact(java.lang.String dir, java.lang.String dbName, java.lang.String user, java.lang.String password)Utility method to compact a database.static voidmain(java.lang.String... args)This method is called when executing this sample application from the command line.
-
-
-
Method Detail
-
main
public static void main(java.lang.String... args) throws java.lang.ExceptionThis method is called when executing this sample application from the command line.- Parameters:
args- the command line parameters- Throws:
java.lang.Exception- on failure
-
compact
public static void compact(java.lang.String dir, java.lang.String dbName, java.lang.String user, java.lang.String password) throws java.sql.SQLExceptionUtility method to compact a database.- Parameters:
dir- the directorydbName- the database nameuser- the user namepassword- the password- Throws:
java.sql.SQLException- on failure
-
-