Category Archives: Java


  1. Shut down the database.
    shutdown immediate;
  2. Restart the database in UPGRADE mode.
    startup upgrade;
  3. Change the setting of MAX_STRING_SIZE to EXTENDED.
    ALTER SYSTEM SET max_string_size=extended SCOPE=SPFILE;
  4. Run the rdbms/admin/utl32k.sql script. You must be connected AS SYSDBA to run the script.
  5. Restart the database in NORMAL mode.
    shutdown immediate;
  6. Run the rdbms/admin/utlrp.sql script to recompile invalid objects. You must be connected AS SYSDBA to run the script.

Convert TimeZone In Java And Sql

In Java (Require >= Java 8) :

How to use :

In MySql :

Snippet Java for Redshift

With snippet Java for Redshift, you can free your mind

  1. Open JDBC Connection and Change Schema

  2. Example Copy Data Gzipped to Table with Column Names

  3. Generate Manifest File Content

Snippet Maven

With snippet Maven, you can free your mind

  1. Create a Jar with Dependencies using

    and you run it with

  2. Create a Jar with Dependencies using

    and you run it with

    Compile goal should be added before

    or otherwise the code on your own project is not included.

    Commonly this goal is tied to a build phase to execute automatically. This ensures the JAR is built when executing

    or performing a deployment/release.

  3. Create a Jar with Dependencies using

    You can use the dependency-plugin to generate all dependencies in a separate directory before the package phase and then include that in the classpath of the manifest:

    Alternatively use “${}/classes/lib” as OutputDirectory to integrate all jar-files into the main jar, but then you will need to add custom classloading code to load the jars.

  4. Delete additional directories and files using

    The Maven Clean Plugin will delete the

    directory by default. You may configure it to delete additional directories and files.

    Note: The directory in the fileset is a relative path inside a project, in other words

    is equivalent to:

  5. Set UTF-8 for project when build

  6. Compiler exclude the specified packages and their subpackages

Maven setting up the Internal Repository

Add internal repository from project

${basedir} is variable of eclipse

Local File In Project
Local Repo

Add dependency

  • When using command mvn eclipse:eclipse , maven will copy file from folder repo to folder .m2 (C:\Users\EURO\.m2\repository\com\amazon\RedshiftJDBC41\
  • On EC2 server you must deploy your library to folder /usr/lib/jvm/jre/lib/ext/RedshiftJDBC41-