Adsense Ad

Tuesday 29 September 2020

Run Multiple Java Versions On Windows

?Queries?
We have a couple of applications running on Java 8 and would like now to bring in an application based on Java 6. Can both java versions work together in Windows platform?

Is there any control panel to set the appropriate Java version for different applications, or any other way to set up, what version of Java will be used to run that particular application?

Solution
Of course we can use multiple versions of Java in Windows platform and different applications can use different Java versions. How is your application started? Usually you will have a batch file where there is something like

Java....

This will search the Java executable using the PATH variable. So if Java 8 is first on the PATH, you will have problems running a Java 6 application. You should then modify the batch file to use a certain Java version e.g. by defining a environment variable JAVA6HOME with the value C:\java\java6 (if Java 6 is installed in this directory) and change the batch file calling

%JAVA6HOME%\bin\java ...


It is absolutely possible to install side-by-side several JRE/JDK versions. Moreover, you don't have to do anything special for that to happen, as Sun is creating a different folder for each (under Program Files).

There is no control panel to check which JRE works for each application. Basically, the JRE that will work would be the first in your PATH environment variable. You can change that, or the JAVA_HOME variable, or create specific cmd/bat files to launch the applications you desire, each with a different JRE in path.


It should be possible changing setting the JAVA_HOME environment variable differently for specific applications.

When starting from the command line or from a batch script you can use 
set JAVA_HOME=C:\...\j2dskXXX to change the JAVA_HOME environment.

It is possible that you also need to change the PATH environment variable to use the correct java binary. To do this you can use 
set PATH=%JAVA_HOME%\bin;%PATH%.

Invoking Java with "java -version:1.5", etc. should run with the correct version of Java. (Obviously replace 1.5 with the version you want.) If Java is properly installed on Windows there are paths to the vm for each version stored in the registry which it uses so you don't need to mess about with environment versions on Windows.

Or use links. While it is rather unpleasant to update the PATH in a running environment, it's easy to recreate a link to a new version of JRE/JDK. So:

  • install different versions of JDK you want to use
  • create a link to that folder either by junction or by built-in mklink command
  • set the PATH to the link
  • If other version of java is to be used, delete the link, create a new one, PATH/JAVA_HOME/hardcoded scripts remain untouched
Also, use a simple script when starting jmeter with our own java version

setlocal 
set JAVA_HOME="c:\java8" 
set PATH=%JAVA_HOME%\bin;%PATH%; 
java -version

If you use Java Web Start (you can start applications from any URL, even the local file system) it will take care of finding the right version for your application.



Using Java Web Start, you can install multiple JRE, then call what you need. On win, you can make a .bat file:


  • Online Version:
<your_JRE_version\bin\javaws.exe> -localfile -J-Djnlp.application.href=<the url of .jnlp file.jnlp> -localfile -J "<path_temp_jnlp_file_.jnlp>"

  • Launch from cache:
<your_JRE_version\bin\javaws.exe> -localfile -J "<path_of_your_local_jnlp_file.jnlp>"

Tuesday 4 August 2020

FRM-40831: Truncation Occurred: value too long for field XXXXX

Cause:

1. Form field length and database column length may not be same.

2. Minimum query length Property.

3. Data Length Semantics property and Unicode.

 

Solution:

1. Check the Form field length and database column length.

2. Your base table field query length (in the Results block) must be long enough to contain the query criteria. If it is not, you get an error that the value is too long for your field. All fields should have a minimum query length of 255.

3. If you have radio groups, list items, or check boxes based on database fields in your Results block, you should only copy those values from the Find window if they are not NULL.

4. If you ever need to adjust the default WHERE clause, remember to set it back when you do a non-query-find query.


Monday 29 June 2020

Do you want to save changes you have made

In Oracle Forms After querying records and exiting from form you often receive message "Do you want to save changes you have made".


Reason is very simple you are updating the fields in most probably post-query or other trigger. when any field changes, the changes ask to save it.

Solution is also very simple:

Use below line at the end of all post query triggers:
set_record_property(:system.trigger_record,:system.trigger_block,status,query_status);

OR

Use: set_item_property(<block_name.item_name>, item_is_valid, property_true);

Monday 22 June 2020

Oracle Forms 10G Icons

Deploying Icons and Images Used by Forms Services

This section explains how to specify the default location and search paths for icons and images in Registry.dat.

Managing Registry.dat with Application Server Control

Use Application Server Control to change, add, or delete parameters from Registry.dat.

To change a Registry.dat parameter value:

  1. Select the Configuration page of Enterprise Manager.

  2. From the View dropdown list, select Forms Font and Icon Mapping (Registry.dat).

  3. Select a radio button next to a parameter and change the value(s) for it in the Value text field.

  4. Click Apply.

    Your changes are saved.

To add a Registry.dat parameter and its value:

  1. Select the Configuration page of Enterprise Manager.

  2. From the View dropdown list, select Forms Font and Icon Mapping (Registry.dat).

  3. At the bottom of the Registry.dat page, enter a name for the parameter in the Name text field.

  4. Enter a value for this new parameter in the Value text field.

  5. Click Add New Parameter.

    Your changes are saved.

To delete a Registry.dat parameter and its value:

  1. Select the Configuration page of Enterprise Manager.

  2. From the View dropdown list, select Forms Font and Icon Mapping (Registry.dat).

  3. Select a radio button next to a parameter and click Delete.

  4. The Confirmation page appears, click Yes.

  5. The parameter is deleted and the Configuration page reappears.

Deploying Application Icons

When deploying an Oracle Forms application, the icon files used must be in a Web-enabled format, such as JPG or GIF (GIF is the default format).

By default, the icons are found relative to the DocumentBase directory. That is, DocumentBase looks for images in the directory relative to the base directory of the application start HTML file. As the start HTML file is dynamically rendered by the Forms Servlet, the forms directory becomes the document base.

For example, if an application defines the icon location for a button with myapp/<iconname>, then the icon is looked up in the directory forms/myapp.

To change the default location, set the imageBase parameter to codebase in the Forms Web Configuration page of Enterprise Manager Application Server Control Console. Alternatively, you can change the default.icons.iconpath value of the Registry.dat file in the forms/java/oracle/forms/registry directory.

Setting the imageBase parameter to codebase enables Oracle Forms to search the forms/java directory for the icon files. Use this setting if your images are stored in a Java archive file. Changing the image location in the Registry.dat configuration file is useful if you want to store images in a central location independent of any application and independent of the Oracle Forms installation.

Storing Icons in a Java Archive File

If an application uses a lot of custom icon images, it is recommended you store icons in a Java archive file and set the imageBase value to codebase. The icon files can be zipped to a Java archive via the Jar command of any Java Software Development Kit (Java SDK).

For example, the command jar -cvf myico.jar *.gif packages all files with the extension .gif into an archive file with the name myico.jar.

In order for Oracle Forms to access the icon files stored in this archive, the archive needs to be stored into the forms/java directory. Also, the name of the archive file must be part of the archive tag used in the custom application section of the formsweb.cfg file (for example, archive_jini=frmall_jinit.jar, myico.jar). Now, when the initial application starts, the icon files are downloaded to and permanently stored on the client until the archive file is changed.


Note:

You do not need to deploy Oracle Forms default icons (for example, icons present in the default smart icon bar), as they are part of the frmall.jar file.

Adding Icon Changes to Registry.dat

If you want to add icon changes to the Registry.dat file used by your application, it is recommended that you make a copy of the existing Registry.dat file and edit the copied file.

To create a copy of the Registry.dat file: 

  1. Copy the Registry.dat text file found in the ORACLE_HOME/forms/java/oracle/forms/registry directory to another directory. This directory must be mapped to a virtual directory for your Web server (for example, /appfile).

  2. Rename this new file (for example, myapp.dat).

  3. Modify the iconpath parameter specifying your icon location:

    default.icons.iconpath=/mydir or http://myhost.com/mydir 
    

    (for an absolute path)

    or

    default.icons.iconpath=mydir 
    

    (for a relative path, starting from the DocumentBase Directory)

  4. Modify the iconextension parameter:

    default.icons.iconextension=gif
    

    or

    default.icons.iconextension=jpg
    

To reference the application file: 

  • In a specific named configuration section in the formsweb.cfg file, modify the value of the serverApp parameter and set the value to the location and name of your application file.

    For example:

    [my_app]
    ServerApp=/appfile/myapp

    (for an absolute path)

    or

    [my_app]
    ServerApp=appfile/myapp

    (for a relative path, relative to the CodeBase directory)

    "Icon Location Guide" describes the correct locations where to place your application icons:

Icon Location Guide

Icon LocationWhenHow

DocumentBase

Default. Applications with few or no custom icons.

Store icons in forms directory or in a directory relative to forms.

Java Archives

Applications that use many custom icons

Set ImageBase to codebase, create Java archive file for icons, and add archive file to the archive parameter in formsweb.cfg.

Registry.dat

Applications with custom icons that are stored in a different location as the Oracle Forms install (can be another server).

Useful if you need to make other changes to the Registry.dat file like font mapping.

Copy Registry.dat and change ServerApp parameter in formsweb.cfg.


SplashScreen and Background Images

When you deploy your applications, you have the ability to specify a splash screen image (displayed during the connection) and a background image file.

Those images are defined in the HTML file or you can use the Forms Web Configuration page in Enterprise Manager:

<PARAM NAME="splashScreen" VALUE="splash.gif">
<PARAM NAME="background" VALUE="back.gif">

The default location for the splash screen and background image files is in the DocumentBase directory containing the baseHTML file.

Custom Jar Files Containing Icons and Images

Each time you use an icon or an image (for a splash screen or background), an HTTP request is sent to the Web server. To reduce the HTTP round-trips between the client and the server, you have the ability to store your icons and images in a Java archive (Jar) file. Using this technique, only one HTTP round-trip is necessary to download the Jar file.

Creating a Jar File for Images

The Java SDK comes with an executable called jar. This utility enables you to store files inside a Java archive. For more information, see http://java.sun.com/.

For example:

jar -cvf myico.jar Splash.gif Back.gif icon1.gif

This command stores three files (Splash.gifBack.gificon1.gif) in a single Jar file called myico.jar.

Using Files Within the Jar File

The default search path for the icons and images is relative to the DocumentBase. However, when you want to use a Jar file to store those files, the search path must be relative to the CodeBase directory, the directory which contains the Java applet.

If you want to use a Jar file to store icons and images, you must specify that the search path is relative to CodeBase using the imageBase parameter in the formsweb.cfg file or HTML file.

This parameter accepts two different values:

  • DocumentBase The search path is relative to the DocumentBase directory. It is the default behavior.

  • CodeBase The search path is relative to the CodeBase directory, which gives the ability to use Jar files.

In this example, we use a JAR file containing the icons and we specify that the search should be relative to CodeBase. If the parameter imageBase is not set, the search is relative to DocumentBase and the icons are not retrieved from the Jar file.

For example (formsweb.cfg):

archive=frmall.jar, icons.jar
imageBase=codebase

Search Path for Icons and Images

The icons and images search path depends on:

  • What you specify in your custom application file (for the icons).

  • What you specified in the splashScreen and background parameters of your default Forms Web configuration or HTML file (for the images).

  • What you specify in the imageBase parameter in the Forms Web Configuration page of Application Server Control for the file or HTML file (for both icons and images).

Forms Services searches for the icons depending on what you specify. This example assumes:

  • host is the computer name.

  • DocumentBase is the URL pointing to the HTML file.

  • CodeBase is the URL pointing to the location of the starting class file (as specified in the formsweb.cfg file or HTML file).

  • mydir is the URL pointing to your icons or images directory.

DocumentBase

The default search paths for icons and images are relative to the DocumentBase. In this case, you do not need to specify the imageBase parameter:

Search Paths for Icons

Location SpecifiedSearch path used by Forms Services

default

http://host/documentbase

iconpath=mydir

(specified in your application file)

http://host/documentbase/mydir

(relative path)

iconpath=/mydir

(specified in your application file)

http://host/mydir

(absolute path)


Search Paths for Images

Location SpecifiedSearch path used by Forms Services

file.gif (specified, for example, in formsweb.cfg as splashscreen=file.cfg)

http://host/documentbase/file.gif

mydir/file.gif

http://host/documentbase/mydir/file.gif

(relative path)

/mydir/file.gif

http://host/mydir/file.gif

(absolute path)


CodeBase

Use the imageBase=CodeBase parameter to enable the search of the icons and images in a Jar file:

Icon Search Paths Used by Forms Services

Location SpecifiedSearch Path Used by Forms Services

default

http://host/codebase or root of the Jar file

iconpath=mydir

(specified in your application file)

http://host/codebase/mydir or in the mydir directory in the Jar file

(relative path)

iconpath=/mydir

(specified in your application file)

http://host/mydir

(absolute path)

No Jar file is used


Image Search Paths Used by Forms Services

Location SpecifiedSearch Path Used by Forms Services

file.gif

http://host/codebase/file.gif or root of the Jar file

mydir/file.gif

(specified in your HTML file)

http://host/codebase/mydir/file.gif or in the mydir directory in the Jar file

(relative path)

/mydir/file.gif

(specified in your HTML file)

http://host/mydir/file.gif

(absolute path)

No Jar file is used.

Thursday 18 June 2020

Oracle Reports and PDF fonts problem

Solution:

On Server change the default printer driver to PCL or Postscript as follows:

1. Open Printers folder.
2. Click on Add new printer.
3. Select Local Printer.
4. Select "File" for the Port.
5. Select HP Laserjet 5si PS if no printer is installed.
6. Set this as default printer.
7. Restart report server.
8. Re-run the report to PDF output and confirm that fonts remain constant
between the PDF file and Reports Builder.

Friday 5 June 2020

Create Workspace On Oracle Apex 20.1

First of all I would like to thank my friend Mr. Ahsan Hussain for this wonderful document to help us  understand the Oracle Apex 20.1 Workspace creation in an easy way. 

Click to download this document.


Step1: Scroll Down the page


Step 2: Click on Administration



 

 










Step 3: login with admin user








 






Step 4: Click on Create Workspace









 

 

 

Step 5: Enter workspace name









 


 



Step 6: Select schema












 

Step 7: Enter Administrative username and password and also email_id










 

 


Step 8: Click on create workspace



Step 9: Login to your workspace





 



Oracle Apex 20.1 Installation

First of all I would like to thank my friend Mr. Ahsan Hussain for this wonderful document to help us  understand the Oracle Apex 20.1 Installation in an easy way. 

Click to download this document.

Step 1: Download and extract the file apex_20.1_en to apex_20.1


 

Step 2: Connect db as sysdba and execute command “@apexins.sql sysaux sysaux temp /i/”

 


 

 

Step 3: Execute command “@apxchpwd.sql” after execution press enter it will select admin username by default


 

Step 4 : now enter email id



 











Step 5: Enter your password according to policy





 







Step 6: Execute command “@apxldimg.sql C:\apex_20.1”




 

 

 








Step 7: Execute command @apex_rest_config.sql” and set password same as before






 








Step 8: Execute command “@apex_epg_config.sql”








 

 





Step 9: Execute below commands

“EXEC DBMS_XDB.sethttpport(8080)”

“alter user ANONYMOUS account unlock”

“alter user XDB account unlock”






 


 






Step 10 : now open link on your browser “http://localhost:8080/apex”, 













Thank you.



Connect Oracle 12c With PHP

First of all I would like to thank my friend Mr. AhsanHussain for this wonderful document to help us understand the Oracle Database connection with PHP in an easy way.

Wednesday 27 May 2020

Solution for Error FRM-92095: Oracle Jnitiator version too low

Java - How to fix Oracle-Jinitiator version too low. Please install version 1.1.8.2 or higher - Java 7 or above

Overview
FRM-92095: Oracle-Jinitiator version too low. Please install version 1.1.8.2 or higher.

Opening Oracle Forms (Smart Center, e.Notify) in any browser (Chrome, Firefox, or Internet Explorer) on Windows produces an error indicating that the Jinitiator version is too low.



Cause:

Java 7 is installed. As of Java 7 Update 6, Oracle made an internal change in the Java plugin that causes Oracle Forms (Banner) to not recognize that Java is correctly installed.

Fix:
Determine if your computer is x64 or x86 processor type.
Windows XP
Right click My Computer and go to Properties to access the System Properties.

Windows 7
Right click My Computer and go to Properties. Click on System Properties to access the System Properties menu.

x86
Start Menu -> Control Panel -> Programs -> Java (or search for Java in the upper right box labeled Search Control Panel).

After the Java Control Panel opens, go to the Java tab and click the view button.



Click the section labeled Runtime Parameters and paste the following value in the box (everything exactly as typed to the right of the colon):-Djava.vendor="Sun Microsystems Inc."

Click OK to close this screen.

Click OK again to close the Java Control Panel.

Now, you should be able to launch your favorite browser and run Oracle Forms without encountering the Jinitiator error message. Note that updating Java may require you to go through these steps again.

x64

Open Start Menu and paste this: "C:\Program Files (x86)\Java\jre7\bin\javacpl.exe" into the box labeled "Search programs and files." Press enter. Do NOT use the method above to open the Java Control Panel on 64-bit Windows. It will open the wrong version of the Java plugin. If this does not come up automatically in the search you can manually browse to it.

After the Java Control Panel opens, go to the Java tab and click the view button.



Click the section labeled Runtime Parameters and paste the following value in the box (everything exactly as typed to the right of the colon):-Djava.vendor="Sun Microsystems Inc."

Click OK to close this screen.

Click OK again to close the Java Control Panel.

Now, you should be able to launch your favorite browser and run Oracle Forms without encountering the Jinitiator error message. Note that updating Java may require you to go through these steps again.