Recent Notes
Displaying keyword search results 1 - 10
Created by meiu on February 09, 2010 03:26:14
Last update: March 31, 2011 09:00:19
Simple JDBC code for Oracle.
import java.sql.*;
public class JDBCHelloWo...
Created by Fang on March 23, 2010 01:43:47
Last update: September 03, 2010 14:21:15
This is a bare bones, no frills, just the facts tutorial on JSTL. I will not bother you with theories, principles, best practices, anecdotes, or any other junk, because JSTL is shallow and simple, and I don't want to make it sound deep or complex. Getting ready JSTL/JSP Expression Language JSTL implicit variables A simple test application for JSTL Expanding the simple JSTL test application Core Tags Basic tags : <c:out> , <c:set> , <c:remove> , <c:catch> Flow control tags : <c:if> , <c:choose> , <c:when> , <c:otherwise> , <c:forEach> , <c:forTokens> URL Tags : <c:import> , <c:url> , <c:redirect> , <c:param> Internationalization (i18n) and formatting tags I18N Overview Set locale : <fmt:setLocale> , <fmt:requestEncoding> Format messages : <fmt:message> , <fmt:bundle> , <fmt:setBundle> , <fmt:param>...
Created by Fang on March 23, 2010 03:50:11
Last update: August 18, 2010 21:59:52
This is a simple web application with a single servlet and a single JSP page. It is intended to be a test bed for JSTL tags. You may want to store all syntax, rules, and exceptions in your head, but in my opinion nothing beats a simple test program that allows you play with it all you want. So here it is (build with Maven ). Prerequisites: Maven: http://maven.apache.org/ . You don't need any prior knowledge of Maven, but you need to install the binary. JBoss: http://jboss.org/jbossas/downloads/ , or Tomcat: http://tomcat.apache.org/ if you don't run the SQL tests. You need to know how to deploy a web application (shh! Don't tell your boss it's just copying a file to the deployment folder). Steps: The directory...
Created by Fang on August 16, 2010 22:00:05
Last update: August 16, 2010 22:12:25
The tags <sql:update> Executes SQL INSERT , UPDATE , DELETE statements, or SQL DDL statements. Syntax:
<sql:update sql="sqlUpdate" [dataSource="d... or, put the SQL within the element body: <sql:update [dataSource="dataSource"] [v... Attributes: Name Dynamic? Type Description sql true String SQL update statement. dataSource true javax.sql.DataSource or String Data source associated with the database to update. A String value represents a relative path to a JNDI resource or the parameters for the JDBC DriverManager class. var false String Name of the exported scoped variable for the result of the database update. The type of the scoped variable is java.lang.Integer . scope false String Scope of var. Defaults to "page". <sql:transaction> Establishes a transaction context for <sql:query> and <sql:update> subtags. Syntax: <sql:transaction [dataSource="dataSource"] ... where...
Created by Fang on August 16, 2010 21:44:41
Last update: August 16, 2010 22:01:46
The tags <sql:query> Queries a database. Syntax:
<sql:query sql="sqlQuery" var="varName" [scope... or, put the query within the element body: <sql:query var="varName" [scope="{page|req... Attributes: Name Dynamic? Type Description sql true String SQL query statement. dataSource true javax.sql.DataSource or String Data source associated with the database to query. A String value represents a relative path to a JNDI resource or the JDBC parameters for the DriverManager class. maxRows true int The maximum number of rows to be included in the query result. If not specified, or set to -1, no limit on the maximum number of rows is enforced. startRow true int The returned Result object includes the rows starting at the specified index. The first row of the original query result set is at index...
Created by Fang on August 16, 2010 20:42:56
Last update: August 16, 2010 20:47:24
Of course you'll need a datasource to run your SQL statements. It can be set in web.xml , or with the <sql:setDataSource> tag. In web.xml , the declaration is something like this:
<context-param> <param-name>javax.servl... where the parameter value is a relative JNDI path, or parameters for a JDBC connection. In the above example, the real JNDI name for the data source would be: java:comp/env/jdbc/myDataSource . You are out of luck if the JNDI path for the data source does not fall under the java:comp/env/ namespace. In the case of JDBC connection parameters, the expected format is: url[, [driver] [, [user] [,password]]] For example: jdbc:mysql://localhost/,org.gjt.mm.mysql.Driver , where no user name or password is used. <sql:setDataSource> Exports a data source either as a scoped variable or...
Created by voodoo on July 12, 2010 18:26:19
Last update: July 12, 2010 18:26:19
Use the \i command to run a SQL script file:
postgres=# \i /usr/share/pgsql/contrib/pgcrypto.sq...
Created by voodoo on June 17, 2010 19:39:14
Last update: June 17, 2010 19:39:14
There are two ways to run a SQL script with PostgreSQL:
From shell:
$ psql theScript.sql
Interactively:
postgres=# \i theScript.sql
Created by Dr. Xi on April 06, 2010 22:55:13
Last update: April 06, 2010 22:56:38
These are the steps to diagnose the "javax.jms.Destination found at the specified destination-location" error an MDB in the Oracle application server (oc4j) environment. The data source is correctly configured and connection can be successfully established. Test this from the Oracle AS em console. The destination queue exists and is started. If you are using PL/SQL Developer, you can check this by right clicking on the queue name and make sure that "Enqueue Enabled" and "Dequeue Enabled" are checked. Deployment descriptors are correctly set up. The database user used for the JDBC connection pool has the proper privileges to enqueue and dequeue. Usually this means that the database user is assigned the AQ_USER_ROLE . The ultimate test is to run some PL/SQL code in the oc4j...
Created by Dr. Xi on October 09, 2009 19:27:22
Last update: October 09, 2009 19:30:01
PL/SQL code from Pandazen :
CREATE OR REPLACE FUNCTION GET_INSERT_SCRIPT(V_TAB...
Usage:
To create the script for generating the INSERT statements:
set head off
set pages 0
set trims on
set...
Run the resulting script to generate the INSERT script:
set pages 0
set trims on
set lines 2000
...
PL/SQL code from Oracle Ask Tom
set serveroutput on size 100000
set feedbac...