# Java Source
create or replace and compile java source named JavaUtils as
package com.java.util;
import java.text.SimpleDateFormat;
import java.util.Date;
public class JavaUtils {
  public static void entry(){
    System.out.println(123);
  }
  public static String getNowDate(String dateFormat) throws Exception {
    if(dateFormat == null) dateFormat = "/";
    return getNowYear("") + dateFormat + getNowMonth("") + dateFormat + getNowDay("");
  }
  public static String getNowYear(String dateFormat) throws Exception {
    return new SimpleDateFormat("yyyy").format(new Date());
  }
  public static String getNowMonth(String dateFormat) throws Exception {
    return new SimpleDateFormat("MM").format(new Date());
  }
  public static String getNowDay(String dateFormat) throws Exception {
    return new SimpleDateFormat("dd").format(new Date());
  }
}
# Create Function Test
create or replace noneditionable function java_test(str in STRING)
  -- 包名 + java sources name + 方法名 (参数)
  return string is language java name 'com.java.util.JavaUtils.getNowDate(java.lang.String) return java.lang.String';
  -- return string is language java name 'com.java.util.JavaUtils.getNowYear(java.lang.String) return java.lang.String';
  -- return string is language java name 'com.java.util.JavaUtils.getNowMonth(java.lang.String) return java.lang.String';
  --return string is language java name 'com.java.util.JavaUtils.getNowDay(java.lang.String) return java.lang.String';
Update on Views times

Give me a cup of [coffee]~( ̄▽ ̄)~*

Nico Niconi WeChat Pay

WeChat Pay

Nico Niconi Alipay

Alipay