Skip to content

A java swing application for executing batch SQL DML Statements from files stored in a directory.

License

Notifications You must be signed in to change notification settings

nickrfer/java-sqlbatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLBatch

A java swing application for executing batch DML SQL Statements from files stored in the specified directory.

Codacy Code Badge Circle CI Dependency Status MIT license StackShare Stories in Ready

Details

While reading the files, the program checks if the line starts with a DML Command (INSERT, DELETE, UPDATE, MERGE or CALL) and executes it, otherwise it is ignored.

For better optimization, the commit happens when 1000 batchs are added to the PreparedStatement, and at the final iteration. Logs will be appended to sqlbatch.log where the generated JAR is executed.

The file sqlbatch.properties can be put in the same path as the generated JAR to configure the app form, if the user doesn't want to input the fields everytime. The properties are { db.name, server.name, db.port, db.user, db.password, import.path }.

If an error occurs while executing the commands, a message popup is shown stating the error, the line that contains the command that caused the error, and the line that contains the command that was last commited so the user can manually remove the lines above and the commands doesn't get commited again.

So far the SQLBatch app supports the DB2, Oracle and SQL Server Databases. I am planning to add support for other Databases.

Configuration

Since the DB2 and Oracle drivers are not available at the mavenrepository.com, you need to run the following commands after downloading the drivers in order to add the dependencies to the local maven repository:

  • ojdbc7: mvn install:install-file Dpackaging=jar -Dfile=<USER_HOME>/ojdbc7.jar -DgroupId=com.oracle -DartifactId=ojdbc7 -Dversion=12.1.0.1

  • db2jcc: mvn install:install-file Dpackaging=jar -Dfile=<USER_HOME>/db2jcc.jar -DgroupId=com.ibm.db2.jcc -DartifactId=db2jcc -Dversion=3.8.47

  • db2jcc_lcense_cu: mvn install:install-file -Dpackaging=jar -Dfile=<USER_HOME>/db2jcc_license_cu.jar -DgroupId=com.ibm.db2.jcc -DartifactId=db2jcc_license_cu -Dversion=3.8.47

Feel free to fork and change the dependency versions that best suit your needs!

About

A java swing application for executing batch SQL DML Statements from files stored in a directory.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages