Code Snippet

Just another Code Snippet site

Random Post :




[Guava] Tips

Split and trim a list of values :

Splitter split = Splitter.on(CharMatcher.anyOf(",;")).trimResults().omitEmptyStrings();
split .splitToList("1, 2,3,, 5");

Maven dependency :

<dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>19.0</version>
</dependency>

Weblogic : Customize Console

For example, to add a new label in the header of the WLS Console :

Edit the following file :

<WLS_MIDDLEWARE_HOME>/wlserver/server/lib/consoleapp/webapp/framework/skins/wlsconsole/css/console.css

Add the following snippet :

#console-title::after {
    content: "THIS_IS_THE_NEW_MESSAGE";
    color: #FF0000;
    font-weight: bold;
    font-size: 14px;
    padding-left: 250px;
}

,

[Oralce] Table partitioned by Date interval

CREATE TABLE TBL_1 (
  ID                  NUMBER                NOT NULL,
  REQ_TIMESTAMP       DATE                  NOT NULL,
  ...
)
PARTITION BY 
RANGE ( REQ_TIMESTAMP )
INTERVAL(NUMTODSINTERVAL(1, 'DAY'))
STORE IN (TBLSP1, TBLSP2, TBLSP3, TBLSP4, TBLSP5)
(  
   -- Default partition -- 
   PARTITION PART_0 VALUES LESS THAN (TO_DATE('01-01-2010', 'DD-MM-YYYY')) 
);

Data will be spread over 5 different tablespaces using a “round robin” method.
A new partition will be created for each interval (in this case, 1 DAY).

To remove a partition :

ALTER table TBL_1 drop partition for ( to_date('01/01/2015', 'DD/MM/YYYY') );

Previous Posts Next posts