Description :
-------------------------------------------------------------------
By default, an object ResultSet is defined : FORWARD-
ONLY and not SCROLLABLE. So, we can't use next
page or previous page when we view a list page by page.
Object :
-------------------------------------------------------------------
com.javanovic.zzzpackage.dao.xxxDAO.java
Method :
--------------------------------------------------------------------
public List list(int offset, int limit) throws SQLException
Solution :
--------------------------------------------------------------------
Replace the line :
pstmt = conn.prepareStatement(sql);
by :
pstmt = conn.prepareStatement(sql,
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_READ_ONLY);
We define an object ResultSet as SCROLLABLE.
Notes :
-------------------------------------------------------------------
With Oracle 8.1.6 (driver jdbc oracle), we can use next
page or previous page. But the method "rs.getString(1)"
return an Hexadecimal string starting with the prefix "0x".
So, we view an list of hexadecimal string and not ascii.
We must traduce an hexadecimal string to ascii string.
Logged In: NO
Solution to resolve the "Notes - Oracle 8.1.6".
-------------------------------------------------------------------
The method "rs.getString(1)" can return a ascii String but we
must define the environment variable NLS_LANG. This
variable is used by JVM (Tomcat) when we visit the site web.
Server : server Oracle 8.1.6.0.0 on Unix
NLS_LANGUAGE=American
NLS_TERRITORY=America
NLS_CHARACTERSET=WE8ISO8859P15
Client : server Tomcat with JDBC-Thin on WindowsNT
NLS_LANG=American_America.WE8ISO8859P15
To know NLS_PARAMETERS on Server Oracle :
select * from sys.NLS_DATABASE_PARAMETERS
select * from sys.NLS_INSTANCE_PARAMETERS
To define NLS_LANG on WindowsNT :
set NLS_LANG=American_America.WE8ISO8859P15
More information on NLS Character :
http://www.znow.com/sales/oracle/server.816/a76966/ch6.htm
#8036