Programowanie « Różności …

Różności …

12 lutego 2014

NVL NULL, to_date, to_char

Zaszufladkowany do: Oracle,SQL — Tagi: , — Jacek @ 06:47

to_char

27 grudnia 2013

jdeveloper info

Zaszufladkowany do: Java,Linux,Programowanie — Tagi: — Jacek @ 15:57

instalkę uruchamiać jako zwykły user

wersja 11.1.1.7 instalka na 64bit linuksie
najpierw apt-get install libxtst6.i386

start jdeveloper
sh /home/jsen/Oracle/Middleware_jdev11117/wlserver_10.3/common/quickstart/quickstart.sh &

start weblogic server:
~/Oracle/Middleware_jdev11117/user_projects/domains/base_domain$ ./startWebLogic.sh

uruchamianie i zatrzymywanie:
http://help.adobe.com/en_US/enterpriseplatform/10.0/AdminHelp/WS92d06802c76abadb-5145d5d12905ce07e7-7c8f.html

26 grudnia 2013

Algorytm – wyjaśnienie znaczenia :-)

Zaszufladkowany do: Informatyka - pozostałe,Programowanie — Jacek @ 22:40

1 listopada 2013

java library path

Zaszufladkowany do: Java,Programowanie — Tagi: — Jacek @ 05:41

java.library.path is the path that Java uses to find native libraries (such as lwjgl.dll). You should set it to the directory that contains the DLL files. You specify this with the -D switch on the command line, for example:

java -Djava.library.path=C:\Java\ljwgl\libs org.mypackage.MyProgram

http://fedoraproject.org/wiki/Java

29 października 2013

sqldeveloper

Zaszufladkowany do: Java,Programowanie — Tagi: — Jacek @ 16:39

Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will be stored in ~/.sqldeveloper/jdk
/usr/lib/jvm/java

18 października 2013

Multiple Java versions.

Zaszufladkowany do: Java,Programowanie — Tagi: — Jacek @ 20:10
@echo off
echo Setting JAVA_HOME
set JAVA_HOME=”C:\jre6″
echo setting PATH
set PATH=”C:\jre6\bin”;%PATH%
javaw.exe -Djava.library.path=. -Xmx512m -jar C:\Macrologic\system\jTerm\jTerm.jar 192.168.192.192:7777 -ggrupa -a pulpit

13 października 2013

java – two versions

Zaszufladkowany do: Java,Programowanie — Tagi: — Jacek @ 14:31

Maintaining Multiple Java Versions on Red Hat Linux

I had the need to maintain more than one Java version on a Red Hat Linux machine.  I was able to install a new version of Java, and then configure the machine to use the new version by default.  It’s also very easy to switch back to using the previous version of Java.

The first step is to download the Java version that you want from the Oracle/Java web site.  In my case, I downloaded the following file.

jre-6u27-linux-x64-rpm.bin

Executing this file as root will perform the installation.  You’ll, of course, have to make the file executable after download.  By default, the installation “wanted” to install Java in the following directory.

/usr/java/jre1.6.0_27

I still wanted to make the new installation the default Java used by the machine.  Linux has a nice utility called alternatives to do this, and more specifically, the update-alternatives command.  With this command, I was able to first register the newly installed Java as a version of Java that would be recognized by the utility, and I was then able to use the utility to make the new version of Java the default version.  When I used the utility to make the newly installed Java the default, the /usr/bin/java on the machine was modified to point to the new version.

Here is the script that I used to have the new version of Java recognized by the alternatives utility.

JAVA_HOME=/usr/java/jre1.6.0_27

# The following command added the new java installation as a java alternative.
# The slave commands bring the related commands with it.
update-alternatives \
–install /usr/bin/java java $JAVA_HOME/bin/java 1 \
–slave /usr/bin/javac javac $JAVA_HOME/bin/javac \
–slave /usr/bin/javadoc javadoc $JAVA_HOME/bin/javadoc \
–slave /usr/bin/jar jar $JAVA_HOME/bin/jar \
–slave /usr/bin/keytool keytool $JAVA_HOME/bin/keytool \
–slave /usr/local/java java_home $JAVA_HOME

# A web site suggested that these steps would also be required, but they were not
#ln -s /etc/alternatives/java /usr/bin/java
#ln -s /etc/alternatives/javac /usr/bin/javac
#ln -s /etc/alternatives/javadoc /usr/bin/javadoc
#ln -s /etc/alternatives/jar /usr/bin/jar
#ln -s /etc/alternatives/keytool /usr/bin/keytool
#ln -s /etc/alternatives/java_home /usr/local/java

It’s important to make sure that JAVA_HOME is set to point to the new installation directory.  The update-alternatives command links multiple Java utility programs together so that when you switch from one Java version to the next, the proper versions of the related tools come with it (note the slave option in the script above).  One web site I visited indicated that I would have to update symbolic links, but the links were made automatically when I tried this on Red Hat 5 and 6.

Running the script above does not make the new version of Java the default.  It simply registers that version of Java as a known version of java.  Run the following command to change the default.

update-alternatives –config java

You should see the following after entering the above command.

There are 3 programs which provide ‘java’.
Selection    Command
———————————————–
1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
3           /usr/java/jre1.6.0_27/bin/java
Enter to keep the current selection[+], or type selection number:

I entered 3, and pressed the enter key, and the newly installed version of Java became the default.  You can run the update-alternatives command again to change the version back.

I assume that this works on other flavors of Linux as well, but I’ve never tried.  I have done this on both Red Hat Linux 5 and 6

SOURCE:

http://mikes-web-site.blogspot.com/2012/02/maintaining-multiple-java-versions-on.html

28 lutego 2012

PL/SQL temporary tables

Zaszufladkowany do: PL/SQL,Programowanie — Jacek @ 14:41

http://www.oracle-base.com/articles/8i/TemporaryTables.php

22 lutego 2012

Using PL/SQL Loops and Control Structures

Zaszufladkowany do: PL/SQL,Programowanie,Skrypty SQL i PL/SQL — Jacek @ 19:07

http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/controlstructures.htm

PL/SQL varrays.

Zaszufladkowany do: PL/SQL,Programowanie — Jacek @ 12:56

http://www.dba-oracle.com/plsql/t_plsql_varrays.htm

25 stycznia 2012

Retrieve Top N records from a query

Zaszufladkowany do: PL/SQL,Programowanie — Tagi: — Jacek @ 11:39

http://www.techonthenet.com/oracle/questions/top_records.php

23 stycznia 2012

Declaring Collections with %TYPE

Zaszufladkowany do: PL/SQL,Programowanie — Tagi: — Jacek @ 19:28

Example 5-4 Declaring Collections with %TYPE

DECLARE
  TYPE few_depts  IS VARRAY(10)  OF VARCHAR2(30);
  TYPE many_depts IS VARRAY(100) OF VARCHAR2(64);
  some_depts few_depts;

  /* If the type of some_depts changes from few_depts to many_depts,
     local_depts and global_depts will use the same type
     when this block is recompiled */

  local_depts  some_depts%TYPE;
  global_depts some_depts%TYPE;
BEGIN
  NULL;
END;
/

22 stycznia 2012

ora-00054

Zaszufladkowany do: Oracle,PL/SQL — Tagi: — Jacek @ 21:08

ORA-00054: resource busy and acquire with NOWAIT specified

po zerwaniu sesji – nie można zrobić drop table

aby sprawdzić jaka sesja trzyma:

SELECT * FROM DBA_DML_LOCKS;
szczegóły w kolumnie LOCK_ID1:
SELECT * FROM DBA_LOCK_INTERNAL;

źródła:

http://www.dba-oracle.com/t_ora_00054_locks.htm

Prosty CURSOR

Zaszufladkowany do: Oracle,PL/SQL,Programowanie — Tagi: — Jacek @ 20:02
DECLARE
CURSOR C1 IS SELECT ST_ID_OPISOWY_KROTKI, TP_ID_OPISOWY_KROTKI
FROM STW.SRODKI_TRWALE;
BEGIN
FOR rekord1 IN C1 LOOP
Dbms_Output.put_line(rekord1.ST_ID_OPISOWY_KROTKI);
END LOOP;
END;
/

27 listopada 2011

Associative arrays, cursors – PL/SQL

Zaszufladkowany do: PL/SQL — Tagi: — Jacek @ 19:55
declare
02 type apollo_rec is record(
03 commander   varchar2(100),
04 launch date);
05 type apollo_type_arr is table of apollo_rec index by varchar2(100);
06 apollo_arr apollo_type_arr;
07 begin
08 apollo_arr('Apollo 11').commander := 'Neil Armstrong';
09 apollo_arr('Apollo 11').launch :=   to_date('July 16, 1969','Month dd, yyyy');
10 apollo_arr('Apollo 12').commander := 'Pete Conrad';
11 apollo_arr('Apollo 12').launch :=   to_date('November 14, 1969','Month dd, yyyy');
12 apollo_arr('Apollo 13').commander := 'James Lovell';
13 apollo_arr('Apollo 13').launch :=   to_date('April 11, 1970','Month dd, yyyy');
14 apollo_arr('Apollo 14').commander := 'Alan Shepard';
15 apollo_arr('Apollo 14').launch :=   to_date('January 31, 1971','Month dd, yyyy');
16
17 dbms_output.put_line(apollo_arr('Apollo 11').commander);
18 dbms_output.put_line(apollo_arr('Apollo 11').launch);
19 end;
20 /
http://docstore.mik.ua/orelly/oracle/langpkt/ch01_09.htm

http://tylermuth.wordpress.com/2008/02/21/plsql-associative-arrays/

25 listopada 2011

pl/sql package – prosty przykład

Zaszufladkowany do: PL/SQL — Tagi: — Jacek @ 15:03

http://sueharper.blogspot.com/2006/10/running-plsql-code-using-sql-developer.html

typy:
http://dbahelp.co.uk/plsql.aspx

rowtype:
http://www.orafaq.com/wiki/PL/SQL_FAQ

23 listopada 2011

PL/SQL – uruchamianie procedur

Zaszufladkowany do: PL/SQL — Tagi: — Jacek @ 23:02

execute procedure_name

execute procedure_name(‘in_param’,'in_param’);

execute package_name.procedure_name (….

select myPackage.myFunction(rec_id) from myTable;

select myPackage.myFunction(argValue) from dual;

SQL> @pass2proc
SQL> CREATE OR REPLACE PROCEDURE PASS2PROC(VAL1 IN NUMBER, VAL2 OUT NUMBER)
  2  AS
  3  BEGIN
  4  	VAL2 := VAL1*2;
  5  END PASS2PROC;
  6  /

Procedure created.

SQL> var ret1 number
SQL> exec pass2proc(1,:ret1);

PL/SQL procedure successfully completed.

SQL> print ret1

      RET1
----------
	 2

ORA-01882 on SQL Developer

Zaszufladkowany do: Oracle,PL/SQL — Tagi: , — Jacek @ 18:46

Edit sqldeveloper.conf configuration file located in the folder SQLDeveloper / bin

Add this line with the timezone:

AddVMOption -Duser.timezone="Europe/Warsaw"

Restart and try again.

SQL – duplicates

Zaszufladkowany do: SQL — Tagi: — Jacek @ 12:06

Here’s a handy query for finding duplicates in a table. Suppose you want to find all email addresses in a table that exist more than once:

SELECT email,
 COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )

You could also use this technique to find rows that occur exactly once:

SELECT email
FROM users
GROUP BY email
HAVING ( COUNT(email) = 1 )
Źródło: http://www.petefreitag.com/item/169.cfm

22 listopada 2011

Instalacja Java7 na Fedora 16 (64 bit)

Zaszufladkowany do: Java,Linux,Programowanie — Tagi: , — Jacek @ 15:55

http://www.if-not-true-then-false.com/2010/install-sun-oracle-java-jdk-jre-7-on-fedora-centos-red-hat-rhel/

http://www.oracle.com/technetwork/java/javase/downloads/index.html

ia32-libs is a Debian(/Ubuntu) package name, it brings the 32-bit
version of the C standard library. The Fedora equivalent is glibc.i686.
So here:
# yum install glibc.i686

sprawdzenie wersji:

glibc (ldd –version)

java (java -version)

lokalizacja: /usr/java/latest

« Nowsze wpisyStarsze wpisy »

Strona startowa: www.jaceksen.pl