Category Archives: Java

INCREASE MAX STRING SIZE OF VARCHAR2 FROM 4000 BYTE TO 32768 BYTE

https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/MAX_STRING_SIZE.html#GUID-D424D23B-0933-425F-BC69-9C0E6724693C

  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.
    @/app/oracle19c/product/19.3/db/rdbms/admin/utl32k.sql;
  5. Restart the database in NORMAL mode.
    shutdown immediate;
    startup;
  6. Run the rdbms/admin/utlrp.sql script to recompile invalid objects. You must be connected AS SYSDBA to run the script.
    @/app/oracle19c/product/19.3/db/rdbms/admin/utlrp.sql;

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 “${project.build.directory}/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\1.1.9.1009)
  • On EC2 server you must deploy your library to folder /usr/lib/jvm/jre/lib/ext/RedshiftJDBC41-1.1.9.1009.jar.