Search This Blog

Sunday, February 16, 2025

How to Implement Password Hide/Show in Login Page

Follow these steps to enable users to toggle between hiding and showing their password on the login page.

Step 1: Add the Function and Global Variable

First, you need to add the following JavaScript function and global variable to your login page.

function viewPW() {
   var Vpw = document.getElementById('P9999_PASSWORD'); 
// The password input field
   var VsetIcon = document.getElementById('pwItem'); 
// The icon for toggling visibility

    if (Vpw.type !== 'password') {
        // Hide password: change type to 'password' and show the eye icon
        Vpw.type = 'password';
        VsetIcon.className = 'fa fa-eye pw-item-icon'; // 'eye' icon
    } else {
    // Show password: change type to 'text' and show the 'eye-slash' icon
        Vpw.type = 'text';
        VsetIcon.className = 'fa fa-eye-slash pw-item-icon'; // 'eye-slash' icon
    }
}

Step 2: Add the Inline CSS

Next, insert this inline CSS to style the visibility toggle icon and place it to the right of the password input.

.pw-item-icon {
    float: right;
    margin-left: -30px;
    margin-top: 11px;
    position: relative;
    z-index: 1;
}

Step 3: Add the Toggle Icon to Your Password Input Field

Finally, insert the following HTML code right after your password input field. This code will create the eye icon that the user can click to toggle password visibility.

<span id="pwItem" class="fa fa-eye pw-item-icon" onClick="viewPW()" 
aria-hidden="true"></span>


Saturday, February 15, 2025

Automatic ORDS start / Create a windows service to open a software automatically

Step 1: Create the Batch File

  1. Open a text editor (like Notepad) and add the following code, replacing the path with your Oracle ORDS directory:
@echo off
cd C:\Oracle\app\ords
java -jar ords.war
pause
  1. Save the file with a .bat extension (e.g., start_ords.bat).

Step 2: Test the Batch File

  1. Double-click the .bat file to ensure it starts Oracle ORDS properly.

  2. Once confirmed, move the file to the ORDS installation directory (e.g., C:\Oracle\app\ords).


Step 3: Download NSSM

  1. Go to the following link and download NSSM (Non-Sucking Service Manager) version 2.24:

    NSSM 2.24 Download Link

  2. Extract the contents of the ZIP file to a folder, then move the extracted folder to your C: drive.


Step 4: Install ORDS as a Service

  1. Navigate to the folder where NSSM was extracted (C:\nssm-2.24\win64).

  2. In the file explorer, hold Shift and right-click inside the folder. Select "Open command window here" or "Open PowerShell window here."

  3. In the command prompt, type:

nssm.exe install

Step 5: Configure the Service

  1. In the NSSM window that opens, browse to the .bat file you created earlier.
  2. Set the "Shutdown" option to "None."
  3. Provide a service name (e.g., ORDS_Service) and click "Install."

Step 6: Set the Service to Start Automatically

  1. Open the Services application (press Windows + R, type services.msc, and hit Enter).
  2. Find the service you just created (ORDS_Service), right-click it, and select "Properties."
  3. Set the "Startup type" to "Automatic" and click "OK."

That’s it! ORDS should now start automatically as a service whenever your system restarts.


Let me know if you need any more tweaks or further details!

Thursday, February 13, 2025

Create List from Navigation Menu

 select null      c1_level,

       ENTRY_TEXT     c2_name_for_label,
       ENTRY_TARGET c3_target_url,
       null      c4_is_current,
       ENTRY_IMAGE  c5_icon_name,
       null      c6_icon_attrs,
       null      c7_icon_alt_text,
       null       c8_user_attr1_badge_text
from APEX_APPLICATION_LIST_ENTRIES where LIST_NAME='Desktop Navigation Menu' and APPLICATION_ID=147 and PARENT_ENTRY_TEXT='Tables & Queries';

Saturday, January 25, 2025

Java to Oracle database Connection Using JDBC

Oracle database.
// Java Program to Establish Connection 
// in JDBC with Oracle Database

// Importing database
import java.sql.*;
// Importing required classes
import java.util.*;

// Main class
class Main {

    // Main driver method
    public static void main(String a[])
    {

        // Creating the connection using Oracle DB
        // Note: url syntax is standard, so do grasp
        String url = "jdbc:oracle:thin:@localhost:1521:xe";

        // Username and password to access DB
        // Custom initialization
        String user = "system";
        String pass = "12345";

        // Entering the data
        Scanner k = new Scanner(System.in);

        System.out.println("enter name");
        String name = k.next();

        System.out.println("enter roll no");
        int roll = k.nextInt();

        System.out.println("enter class");
        String cls = k.next();

        // Inserting data using SQL query
        String sql = "insert into student1 values('" + name
                     + "'," + roll + ",'" + cls + "')";

        // Connection class object
        Connection con = null;

        // Try block to check for exceptions
        try {

            // Registering drivers
            DriverManager.registerDriver(
                new oracle.jdbc.OracleDriver());

            // Reference to connection interface
            con = DriverManager.getConnection(url, user,
                                              pass);

            // Creating a statement
            Statement st = con.createStatement();

            // Executing query
            int m = st.executeUpdate(sql);
            if (m == 1)
                System.out.println(
                    "inserted successfully : " + sql);
            else
                System.out.println("insertion failed");

            // Closing the connections
            con.close();
        }

        // Catch block to handle exceptions
        catch (Exception ex) {
            // Display message when exceptions occurs
            System.err.println(ex);
        }
    }
}

Saturday, January 18, 2025

Confirmation Alert Before Submit / Conditional Button execution using one button JavaScript in Oracle Apex

Using below code you can take a confirmation before execution even you can do conditional button press and execution.

apex.message.confirm( "Would you like to submit for approval? Click OK to continue or Cancel to return to the page", function( okPressed ) { if( okPressed ) { if (apex.item("P23_ITEM").isEmpty()) { apex.page.submit( { request: "CREATE" , showWait: true, } ); } else { apex.page.submit( { request: "SAVE" , showWait: true, } ); } } else { // this code will execute if cancel button pressed apex.item("P23_ITEM2").setValue("N"); } });

Friday, January 17, 2025

Interactive Grid Alternating Row Color

1. Put the CSS into Page properties Inline-> 

.customAlternatingRow .a-IRR-table tr:nth-child(odd) td{background-color:#bac3cc}

.customAlternatingRow .a-IRR-table tr:nth-child(even) td{background-color:#dceaf7}

.customRowHighlight .a-IRR-table tr:hover td{background-color:rgba(103,159,214,.55)}


2. Put the below Class code into the Region CSS Class  

customAlternatingRow customRowHighlight


Tuesday, January 14, 2025

Audit Log Sample Trigger

 create or replace TRIGGER "SCHEMA"."UDS_CALL_LOG_INFO_BIU" 

    BEFORE INSERT OR UPDATE 
    ON "APEX_UDS"."UDS_CALL_LOG_INFO"
    FOR EACH ROW
BEGIN
    IF INSERTING THEN
       IF :NEW.MASTER_ID IS NULL THEN
           SELECT UDS_CALL_LOG_INFO_SEQ.NEXTVAL
           INTO :NEW.MASTER_ID
           FROM DUAL;
         END IF;

         :NEW.CREATED_DATE := LOCALTIMESTAMP;
         :NEW.CREATED_BY:=nvl(v('APP_USER'),USER);
    ELSIF UPDATING THEN 
         :NEW.EDIT_DATE := LOCALTIMESTAMP;
         :NEW.EDITED_BY:=nvl(v('APP_USER'),USER);
    END IF;
  EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line ('An error was encountered '||SQLCODE||' -ERROR- '||SQLERRM);
END UDS_CALL_LOG_INFO_BIU;

Monday, December 9, 2024

PDF to Text Covert by Oracle Apex

Here are the steps to convert and get the character into a region by Oracle Apex.


Step1.  Create a page and Copy-Pest the below code into Page  Function and Global Variable Declaration

Saturday, November 30, 2024

Online Oracle Database Live SQL Developer , free SQL/DB (23ai!), no sign-up required

Online Oracle Database and SQL Developer. You can practice Oracle SQL PL/SQL on online SQL Developer for free. Even no sign-up is required. 



Tuesday, September 17, 2024

Check Difference Between Two Database Objects

Step-1. Create Two DBLINK to connect with Two Database then


Step-2.

define logindb=DBLINKONE

define remotedb=DBLINKTWO

define schema_name=SCHEMA_NAME

clear col breaks compute

break on OBJECT_TYPE skip 1 

col src_name format a40

col tgt_name format a40

col object_type format a20

col src_length format 999,999

col tgt_length format 999,999

col diff format 999,999

 

With source_tbl as

(SELECT /*+ MATERIALIZE */ type, name

, standard_hash ( LISTAGG(text, ' ' ON OVERFLOW TRUNCATE) WITHIN GROUP (ORDER BY line) , 'SHA1') hash_value

, sum(length(text)) text_length

, max(line) source_lines

FROM     dba_source@&&logindb

where 1 = 1

and owner = '&&schema_name'

and name not like 'BIN$%'

--and type = 'PROCEDURE'

group by type, name)

, target_tbl as

(SELECT /*+ MATERIALIZE */ type, name

, standard_hash ( LISTAGG(text, ' ' ON OVERFLOW TRUNCATE) WITHIN GROUP (ORDER BY line) , 'SHA1') hash_value

, sum(length(text)) text_length

, max(line) source_lines

FROM     dba_source@&&remotedb

where 1 = 1

and owner = '&&schema_name'

and name not like 'BIN$%'

--and type = 'PROCEDURE'

group by type, name)

select nvl(a.type, b.type) object_type, a.name src_name, b.name tgt_name

, nvl(a.text_length,0) src_length, nvl( b.text_length,0) tgt_length 

, abs ( nvl(a.text_length,0) - nvl(b.text_length,0) )  diff

, GREATEST ( a.source_lines, b.source_lines) max_source_lines

, abs ( a.source_lines -  b.source_lines) diff_source_lines

from source_tbl A full outer join target_tbl B

on (a.name = b.name

    and a.type = b.type)

where 1= 1 

--and (a.hash_value <> b.hash_value

--    or nvl(a.text_length,0) <> nvl(b.text_length,0) )

--objects that are available in both environment

and (a.name is not null and b.name is not null)

and abs ( nvl(a.text_length,0) - nvl(b.text_length,0) ) > 10

order by nvl(a.type, b.type), nvl(a.name, b.name)

How to Implement Password Hide/Show in Login Page

Follow these steps to enable users to toggle between hiding and showing their password on the login page. Step 1: Add the Function and Glob...