Read Text File (.txt) Using JSP / Java

<% BufferedReader input = new BufferedReader(new FileReader(“text2read.txt”)); String line = “”; while ((line = input.readLine()) != null) { out.println(line); } output.flush(); input.close(); %> Source: http://experts.about.com/q/JSP-Java-Server…xt-file-JSP.htm Additional example http://www.jguru.com/forums/view.jsp?EID=536740

Valid styles for converting datetime to string

I wrote this little table and procedure to help me remember what style 104 did, or how to get HH:MM AM/PM out of a DATETIME column. Basically, it populates a table with the valid style numbers, then loops through those, and produces the result (and the syntax for producing that result) for each style, given… Continue reading Valid styles for converting datetime to string

Use CAST (or CONVERT) to handle Null Date values in Microsoft SQL Server

In an SQL Server View, a problem is that the DateTime field has many Null values which is causing a problem with the parsing of the data in MSAccess. How to I use CAST (or CONVERT) to handle Null Date values in my SQL Server view? There is a way to use CAST or CONVERT… Continue reading Use CAST (or CONVERT) to handle Null Date values in Microsoft SQL Server

SQL SELECT INTO Statement

The SQL SELECT INTO statement can be used to create backup copies of tables. The SQL SELECT INTO Statement The SELECT INTO statement selects data from one table, creates a new table with the exact structure and size and inserts automatically the selected data into the new table. SQL SELECT INTO Syntax We can select… Continue reading SQL SELECT INTO Statement

JBoss in Action

This book is divided into four parts, containing 15 chapters and two appendices. Chapter 1: The JBoss Application Server If you are using JBoss than you can simply skip Chapter 1. This chapter gets you up and running with JBoss by describing the directories and files that are part of JBoss AS, how to start… Continue reading JBoss in Action

How to create an auto-incrementing column in MS SQL Server 2000

Unlike Microsoft SQL Server 2005 and 2008, MS SQL Server 2000 does not have a ROW_NUMBER() function which applies only to the results of a SELECT query as it doesn’t store any permanent value in the DB. The way it works is in keeping with the principles of relational databases. There is no implict ordering… Continue reading How to create an auto-incrementing column in MS SQL Server 2000