Author: SabinS

session handaling with Servlet

Use URL rewrite to save session data import java.io.IOException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class ShoppingCartViewerRewrite extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType(“text/html”); PrintWriter out = res.getWriter(); out.println(“<HEAD><TITLE>Current Shopping Cart Items</TITLE></HEAD>”); out.println(“<BODY>”); // Get the current session ID, […]

Java Compress data communication Object To BytesArray

http://www.unix.org.ua/orelly/java-ent/servlet/ch10_01.htm http://www.unix.org.ua/orelly/java-ent/servlet/ch10_02.htm http://www.oracle.com/technology/sample_code/tech/java/servlets/htdocs/basic.htm import java.io.*; import java.util.zip.*; public class CompressUtils { public CompressUtils() { } public static byte[] compressObjectToBytesArray(Object obj) throws IOException { byte abyte0[] = null; ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); ObjectOutputStream objectoutputstream = new ObjectOutputStream(bytearrayoutputstream); objectoutputstream.writeObject(obj); objectoutputstream.close(); Deflater deflater = new Deflater(9); byte abyte1[] = bytearrayoutputstream.toByteArray(); deflater.setInput(abyte1); deflater.finish(); byte abyte2[] = new byte[abyte1.length]; […]

Oracle some scripts

http://www.oracle.com/technology/oramag/code/tips2005/010305.html select substr(a.sid,1,10) sid, substr(nvl(b.program,machine),1,30) program, count(*) from v$open_cursor a, v$session b where a.saddr=b.saddr group by substr(a.sid,1,10), substr(nvl(b.program,machine),1,30) order by 3 desc ; Track and Monitor Resources This tip comes from Luis Adalberto, DBA at Universidad Autonoma de Coahuila, in Saltillo, Coahuila, Mexico. Running this query will produce a list of database statements and objects […]

Oracle Concepts and Architecture Database Structures.

Oracle question bank Oracle Concepts and Architecture Database Structures. 1. What are the components of Physical database structure of Oracle Database?. ORACLE database is comprised of three types of files. One or more Data files, two are more Redo Log files, and one or more Control files. 2. What are the components of Logical database […]