Thursday, May 28, 2009

Get all table name in oracle

If you are using Microsoft SQL Server you can use one of these queries.

SELECT *
FROM sys.tables


or

SELECT *
FROM sysobjects
WHERE xtype = 'U'


---

If you are using Oracle, you can use one of these:

SELECT *
FROM all_tables;


or

SELECT *
FROM all_objects
WHERE object_type = 'TABLE';

Friday, May 22, 2009

Hibernate Add Sort

import org.hibernate.Criteria;
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Expression;
import org.hibernate.criterion.Order;


if (status!=null){
Criteria criteria = oSession.createCriteria(com.vidasprint.core.pojo.K_KCLASS.class);
criteria.addOrder(Order.asc( "CLASSNAME" ).ignoreCase());
oK_KClass_List = criteria.add(Expression.in("STATUS", status)).list();

} else{
Criteria criteria = oSession.createCriteria(com.vidasprint.core.pojo.K_KCLASS.class);
criteria.addOrder(Order.asc( "CLASSNAME" ).ignoreCase());
oK_KClass_List = criteria.list();

}

Thursday, May 14, 2009

Auto expand/adjustable iframe

Below is some javascript code that will automatically expand the iframes that we currently use to embed forms.
(1) Paste The blow to the head


<script language="JavaScript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindow.
document.body.scrollHeight;

//change the height of the iframe
document.getElementById('the_iframe').height=
the_height;
}
//-->
</script>


(2)Paste the code below to the body and replace "your page here" with your url



<iframe width="100%" id="the_iframe"
onLoad="calcHeight();"
src="your page here"
scrolling="NO"

frameborder="0"
height="1">
An iframe capable browser is
required to view this web site.
</iframe>

Parent call iframe function

document.getElementById("userFrame").contentWindow.submitForm();

Wednesday, May 06, 2009

Infofusion : clear db

cmd prompt:

infoload db02 -create -force -file NUL


(clear and create database named db02, force to create, and with empty file)

Oracle : Create User

example:create sample2_clean
at Aqua application:

--create user
Create user sample2_clean identified by password
go
--grant access
grant connect to sample2_clean
go
grant resource to sample2_clean
go
grant create any snapshot to sample2_clean
go
grant sysdba to sample2_clean
go