Recent Notes

Displaying keyword search results 31 - 38
Created by Dr. Xi on October 18, 2008 02:46:56    Last update: October 18, 2008 02:47:33
There are four pairs of methods in the java.sql.ResultSet class that deal with BLOBs/CLOBs: Reader getCharacterStream(int columnIndex) / Reader getCharacterStream(String columnName) InputStream getBinaryStream(int columnIndex) / InputStream getBinaryStream(String columnName) Blob getBlob(int i) / Blob getBlob(String colName) Clob getClob(int i) / Clob getClob(String colName) Example code: PreparedStatement pstmt = conn.prepareStatemen...
Created by Dr. Xi on September 29, 2008 23:05:12    Last update: September 29, 2008 23:06:16
These variables are set or used by the Unix shell to modify its behavior. Variable Description ENV=file Name of script that gets executed at startup; Usually, ENV=$HOME/.kshrc FCEDIT=file Editor used by fc (fix command) command. If $FCEDIT is not defined, use $EDITOR, otherwise use the default (vi or ed). FPATH=dirs Directories to search for function definitions; undefined functions are set via typeset -fu . FPATH is searched when these functions are first referenced. HISTFILE=file File in which to store command history. Default is $HOME/.sh_history for Korn shell, $HOME/.bash_history for Bash. If not set, history is lost after logout. HISTSIZE=n Max number of commands to keep in history. HOME=dir Home directory; set by login from passwd file. IFS='chars' Internal field separators. Default is space, tab, and...
Created by Dr. Xi on September 21, 2008 21:04:24    Last update: September 21, 2008 22:27:36
IE uses Notepad as the default editor when you select "View Source" from a web page. You can change it to your favorite editor by adding a couple of keys to the registry: Start regedit Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ Add key View Source Editor Under View Source Editor , add key Editor Name Change the default string value to the full path of your favorite editor. The following is the registry entry for vim (full tip for vim is available from the vim wiki ): Windows Registry Editor Version 5.00 [HKEY_... It is probably easier (less error prone) to edit this in a file and import it back into the registry. The contents of gvim.vbs are: '--- gVim.vbs ------------------------------------... It is OK to use gvim.exe...
Created by Dr. Xi on September 13, 2008 20:52:47    Last update: September 15, 2008 23:04:35
The text source of the stored objects (including stored procedures) are made available in Oracle by three views: USER_SOURCE describes the text source of the stored objects owned by the current user. This view does not display the OWNER column. ALL_SOURCE describes the text source of the stored objects accessible to the current user. DBA_SOURCE describes the text source of all stored objects in the database. These are the columns: Column Name Description OWNER Owner of the object NAME Name of the object TYPE Type of object: FUNCTION, JAVA SOURCE, PACKAGE, PACKAGE BODY, PROCEDURE, TRIGGER, TYPE, TYPE BODY LINE Line number of this line of source TEXT Text source of the stored object If you want to search for a certain keyword in the source,...
Created by Dr. Xi on September 04, 2008 19:14:06    Last update: September 04, 2008 19:14:22
import java.sql.*; import java.io.*; pub...
Created by Dr. Xi on September 04, 2008 18:56:19    Last update: September 04, 2008 18:56:42
If you keep SQL strings in a file, you probably comment it to make it more readable. But when you feed the SQL to JDBC, you may prefer to clean it up. This is a regex to do that. public class CleanupSql { public static voi...
Created by Dr. Xi on August 11, 2007 23:19:26    Last update: August 12, 2007 01:39:33
For SQL Server 2000 and above, there are three functions: SELECT @@IDENTITY When a record is inserted into a table with a identity column, the function @@IDENTITY returns the last identity value that was inserted in the database on the same open connection. If a trigger adds a record into another table, which happens to have an identity column, @@IDENTITY will now return this value instead. SELECT IDENT_CURRENT('tablename') This will give you the most recent identity value for the given table regardless of who inserted it. SELECT SCOPE_IDENTITY() SCOPE_IDENTITY shows the most recently inserted IDENTITY in the current scope (which ignores any triggers that might fire). For SQL Server version prior to 2000, it is customary to use a stored procedure: CREATE PROCEDURE myProc @param1 INT AS......
Created by Dr. Xi on August 11, 2007 16:19:30    Last update: August 11, 2007 16:19:30
select last_name + ", " + first_name "Full Nam...
Previous  1 2 3 4 Next