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.

 

 

 

 

Create a Data Generator using sequence and a loop in Oracle DB

Create a sequence (i.e. “tmp” starting with 10001) to be used in statements:

[sql]CREATE SEQUENCE TMP
START WITH 10001
MAXVALUE 9999999999999999999999
MINVALUE 1[/sql]

Enter the following in a DB-Tool editor:

[sql]begin
FOR Lcntr IN 1..10000
LOOP
insert into customer (surname, forname, some_id, some_field)
values (‘SN’ || tmp.nextval, ‘FN’ || tmp.nextval, 123456, ‘abcdef’);
END LOOP;
commit;
end;[/sql]

Output should be something like this:

[text]SN50076,FN50076,123456,abcdef
SN50077,FN50077,123456,abcdef
SN50078,FN50078,123456,abcdef
SN50079,FN50079,123456,abcdef
SN50080,FN50080,123456,abcdef
SN50081,FN50081,123456,abcdef[/text]

How to remove the number next to JDeveloper caused by SVN

The reason you get some numbers next to file names of JDeveloper (or IPs on project names) is because subversioning is enable in your JDeveloper’s options.

To disable and continue to use your external subversioning system do as follows:

From within JDeveloper:
[text]Versioning > Configure…
Deselect “Versioning Support for Subversion…”[text]

Restart your JDeveloper and the revision numbering should go away.

How to check the version of an Oracle Database with PL/SQL

Login to the database and execute the following:

[sql]select * from v$version;
–OR:
select * from product_component_version;[/sql]

Result:

[text]Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 – 64bit Production
PL/SQL Release 11.1.0.7.0 – Production
CORE    11.1.0.7.0    Production
TNS for 64-bit Windows: Version 11.1.0.7.0 – Production
NLSRTL Version 11.1.0.7.0 – Production[/text]

 

 

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]