Skip to content

Instantly share code, notes, and snippets.

View adriens's full-sized avatar

SALES adriens

View GitHub Profile
@adriens
adriens / LintsSample.java
Created October 24, 2017 21:03
manage csv with jtablesaw and h2
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.github.adriens.open.data.fromages;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
set serveroutput on
call slack();
create or replace
procedure slack
is
req utl_http.req;
res utl_http.resp;
-- !!! here PUT YOUR WEBHOOK's url !!!
url varchar2(4000) := 'https://hooks.slack.com/services/THE_REST_OF_YOUR_SECRET_URL';
buffer varchar2(4000);
content varchar2(4000) := '{"channel":"#general", "username": "sqlplus*", "text":"Hi my tablespace if full :bangbang:"}';
begin
dbms_network_acl_admin.create_acl (
acl => 'utl_https_slack.xml',
description => 'Slack HTTPS Access',
principal => 'SLACK',
is_grant => TRUE,
privilege => 'connect',
start_date => null,
end_date => null
);
# in case you are in a container database, set some option for user creation
alter session set "_ORACLE_SCRIPT"=true;
create user slack identified by slack;
grant connect to slack;
grant create session to slack;
grant resource to slack;
cd C:\app\salad74\virtual\admin\DIDI3\wallet
orapki wallet create -wallet C:\app\salad74\virtual\admin\DIDI3\wallet -pwd WalletPasswd123 -auto_login
orapki wallet display -wallet C:\app\salad74\virtual\admin\DIDI3\wallet
orapki wallet add -wallet C:\app\salad74\virtual\admin\DIDI3\wallet -trusted_cert -cert SLACK.cer -pwd WalletPasswd123
orapki wallet display -wallet C:\app\salad74\virtual\admin\DIDI3\wallet