How to add a Data Source on Oracle 11G Weblogic with JDeveloper 11gR2

How to add a Data Source on Oracle 11G Weblogic with JDeveloper 11gR2

To add a Data Source from JDeveloper:

  1. View > Application Server Navigator
  2. Application Servers > IntegratedWebLogicServer
  3. R-click > Launch Administrative Console…
    -that should be i.e. like “http://127.0.0.1:7101/console/login/LoginForm.jsp”
  4. Login with user/password
  5. From Domain Structure open Services > select Data Sources
  6. New > Generic Data Source
  7. Specify the connection properties:
  • Name: MyConnectionDS (or whatever you defined in your Java app data source)
  • JNDI Name: comp/env/jdbc/MyConnectionDS or jdbc/PoliceConnectionDS
  • Database Type: Oracle
  • > Next
  • Database Driver: Oracle’s Driver (thin) for Instance Connections (versions 9.0.1 or later)
  • > Next
  • Supports Global Transactions
  • One-phase commit
  • > Next
  • Type in: Database Name, Host Name, Port, Database User Name, Password
  • > Next
  • Test Database Connection screen > click Test Your Configuration
  • if “Connection test succeeded.”, click Finish

Your new data source should be ready to use for local server run/debug.

 

 

 

 

How to compile a single form from command-line Oracle Forms 11g

Create a batch file and enter the following:

[bash]@echo off
echo.
echo. [ Forms Compiler ]
echo.
:: set varables
set FRMCMP=c:\Oracle\Middleware\as_1\bin\frmcmp.exe
set FORMS_DIR=c:\Users\Administrator\java\projects\DOMAIN_NAME\FormsReportsSystem\Forms
set USER_PATH=c:\Users\Administrator
set DEST=c:\FORM_EXECUTABLES
:: get input from console
set /p choice=  Type the form name (w/o extension):
set FORM_NAME=%choice%.fmb
echo.
cd %FORMS_DIR%\tmp
echo. Compiling…
:: command line execution
frmcmp.exe module=%FORMS_DIR%\tmp\%FORM_NAME% userid=user/pass@dbname module_type=form batch=yes compile_all=yes window_state=minimize
set FORM_FMX=%choice%.fmx
echo.        %choice%.fmx created.
echo.
echo. Copy to server…
copy /y %choice%.fmx %DEST%
echo. Done.
echo.
echo. Press any key to re-run…
pause > nul
cls
cd c:\Users\Administrator[/bash]

 

Webutil syntax for GET_FILE_NAME/CLIENT_GET_FILE_NAME function

[sql]FUNCTION GET_FILE_NAME (or CLIENT_GET_FILE_NAME)
(directory_name   VARCHAR2,
file_name        VARCHAR2,
file_filter      VARCHAR2,
message          VARCHAR2,
dialog_type      NUMBER,
select_file      BOOLEAN;[/sql]

Params descriptions

[text]directory_name = Specifies the name of the directory containing the file you want to open. The default value is NULL. If directory_name is NULL, subsequent invocations of the dialog may open the last directory visited.

file_name = Specifies the name of the file you want to open. The default value is NULL.

file_filter = Specifies that only particular files be shown. The default value is NULL. File filters take on different forms, and currently are ignored on the motif and character mode platforms. On Windows, they take the form of “Write Files (*.WRI)|*.WRI|” defaulting to “All Files (*.)|.*|” if NULL. On the Macintosh the attribute currently accepts a string such as “Text.”

message = Specifies the type of file that is being selected. The default value is NULL.

dialog_type = Specifies the intended dialog to OPEN_FILE or SAVE_FILE. The default value is OPEN_FILE.

select_file = Specifies whether the user is selecting files or directories. The default value is TRUE. If dialog_type is set to SAVE_FILE, select_file is internally set to TRUE.[/text]

 

How to use Webutil in Oracle Forms 11g to save a file on Oracle AS 11g

Before you go into any development download and try the Webutil Demo first and see how that works in your environment!

1. Add the Webutil library to the form

2. Create a Data Block “COMMAND_LINE”

3. Create a new layout with the following parameters:

[text]cmd = command-line parameters (data block only)
filename = filename to be entered
browse = browse for file destination
ok_btn = ok button
cancel_btn = cancel button[/text] (more…)

How to open Oracle Forms URL and then hide its IE started window

You need to open an Oracle Forms 11g url, which in turn will open a new IE window -but you want to somehow get rid of the first IE window.

1. Create a new html file i.e. “openWindow.html”, under %ORACLE_HOME%\forms\java\ as below:

[html]<html>
<body>
<script type=”text/javascript”>
window.open (“http://192.168.1.1:8090/forms/frmservlet?config=webutil”,”mywindow”,”height=1,width=1,toolbar=no,statusbar=no,scrollbars=no,top=5000″);
window.open(”,’_parent’,”);
setTimeout(‘self.close();’,3000);
</script>
</body>
</html>[/html]

Note: top = 5000 sets the window top position at +5000, which places it outside a typical windows screen size.

2. Open an IE window and enter the following URL into the address

[text]http://192.168.1.1:8090/forms/java/openWindow.html[/text]

3. Your Oracle Forms should fire and start working.

 

To close see post 1064