60 Christmas Carols For Kids - $3.69 Download
This is a Sponsored Post written by me on behalf of Madacy Entertainment. All opinions are 100% mine.

Read more...
This is a Sponsored Post written by me on behalf of Madacy Entertainment. All opinions are 100% mine.

It took me a while to figure a good way to insert Blob information into a Microsoft Sql database. Here is an example to insert a Blob into a SQL server database using Java.
The parameters for this method would be the id for the query, an open connection to the SQL Server database, and the InputStream that contains your Blob information. I have another example in one of my other posts that will show you how to populate the InputStream with your particular file.
JDBC Connection
public void insertBlob(String id,Connection conn,InputStream stream) throws Exception { try { PreparedStatement ps=null; String sql="update libraryitemversions set liv_content='' where liv_verguid='" id "'"; ps= conn.prepareStatement(sql); ps.executeUpdate(); sql="select liv_content from libraryitemversions where liv_verguid='" id "'"; ps= conn.prepareStatement(sql); ResultSet set=ps.executeQuery(); Blob blob=null; while(set!=null&&set.next()) { blob=set.getBlob(1); } if(blob!=null) { OutputStream outstream=blob.setBinaryStream(1); byte[] buffer =new byte[BUFFER_SIZE]; int bytesRead=0; while ((bytesRead = stream.read(buffer)) != -1) { outstream.write(buffer, 0, bytesRead); } sql="update libraryitemversions set liv_content=? where liv_verguid='" id "'"; ps= conn.prepareStatement(sql); ps.setBlob(1,blob); ps.executeUpdate(); outstream.flush(); outstream.close(); } else { System.out.println("Error: NO blob found "); } stream.close(); } catch(Exception e) { System.out.println("Error inserting blob " e); } } |
This is a sponsored guest post written by Ali Kendall on behalf of airfare-now.com. Post powered by Sponzai.
Just wanted to send a quick "shout-out" across the Pacific to my friend Ali in sunny Honolulu, Hawaii!
Ali runs the airfare-now.com website with all kinds of tips, coupons, strategies, etc. for findng holiday airfare deals. Now airfare comparison travel sites have come a long way in the past few years but there are still literally thousands of them to choose from. So here's a big aloha and mahalo to Ali for keeping it simple on a pretty nifty little travel website!
Read more...
Displaying the data from the database into Excel.
This is a Sponsored Post written by me on behalf of Charter Communication. All opinions are 100% mine.

Here is some sample code to export data from Java to Excel. You can download the needed jar files from this website: http://poi.apache.org/. They currently are in work to support the new Office 2007 format. The POIFSFileSystem will have a path that points to the location of your excel file you will be populating with the data.
Code Struts Action example
public ActionForward exportXL(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
try
{
OIFSFileSystem fs = new POIFSFileSystem(new FileInputStream(
System.getProperty("catalina.home")+"/webapps/Diamond/WEB-INF/classes/Template.xls"));
HSSFWorkbook wb = new HSSFWorkbook(fs);
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row=null;
HSSFCell cell = null;
row = sheet.createRow(1);
cell = getOrCreateCell(row, (short) 0);
cell.setCellValue( "Put Data Here") ;
cell = getOrCreateCell(row, (short) 1);
cell.setCellValue("Put Data Here");
cell = getOrCreateCell(row, (short) 2);
cell.setCellValue("Put Data Here");
response.setHeader(HEADER_CONTENT_DISPOSITION,"attachment; filename=View.xls");
response.setHeader(HEADER_CONTENT_TYPE, "application/vnd.ms-excel");
// Write the output to a file
ServletOutputStream fileOut = response.getOutputStream();
wb.write(fileOut);
fileOut.close();
}
catch(Exception e)
{
}
return null;
}
This is a Sponsored Post written by me on behalf of Popstation. All opinions are 100% mine.
This is a class that will allow you to download files from an action class either from a file or from the database. The displayFileName is the filename that the user will see when they save their file. The code will check the file extension and set the content type accordingly. The other method is downloading a file from a blob. If you load the blob from the database and you need to open it, you will use this method. It will load the input stream from the blob method and download it accordingly.
Download.java
package com.delegata.common.util;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Blob;
import javax.servlet.http.HttpServletResponse;
/**
* A utility for downloading a given file from file sytem.
*
* @author Greg Dias
*/
public class Download {
public static void downloadFile(HttpServletResponse res, String filename) // filename
// could
// full
// path!
throws Exception {
downloadFile(res, filename, filename);
}
/**
* Method used to download file from file system
*
* @param res
* HttpServletResponse
* @param filename
* File to download
* @param displayFileName
* Display name to show in file dialog box while downloading
* @throws Exception
* Exception
*/
public static void downloadFile(HttpServletResponse res, String filename,
String displayFileName) // filename could be full path!
throws Exception {
File file = new File(filename);
String contentType = "";
boolean ifXLSDOC = false;
// res.setContentType(URLConnection.guessContentTypeFromName(filename));
if (filename.toLowerCase().endsWith(".xls")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
}
if (filename.toLowerCase().endsWith(".xlt")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".csv")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".doc")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".rtf")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".pdf")) {
contentType = "application/pdf";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".ppt")) {
contentType = "application/ms-powerpoint";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".pot")) {
contentType = "application/ms-powerpoint";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".html")) {
contentType = "text/html";
} else if (filename.toLowerCase().endsWith(".htm")) {
contentType = "text/html";
} else if (filename.toLowerCase().endsWith(".gif")) {
contentType = "image/gif";
} else if (filename.toLowerCase().endsWith(".jpg")) {
contentType = "image/jpeg";
} else if (filename.toLowerCase().endsWith(".jpeg")) {
contentType = "image/jpeg";
} else if (filename.toLowerCase().endsWith(".dot")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".vsd")) {
contentType = "application/vnd.visio";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".mpp")) {
contentType = "application/vnd.ms-project";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".zip")) {
contentType = "application/ZIP";
} else if (filename.toLowerCase().endsWith(".txt")) {
contentType = "text/plain";
} else {
contentType = "application/octet-stream";
}
// Set the headers.
res.setContentType(contentType);
if (ifXLSDOC) {
res.addHeader("Content-Disposition", "attachment; filename="
displayFileName);
} else {
res.addHeader("Content-Disposition", "inline; filename="
displayFileName);
}
// Send the file.
OutputStream out = res.getOutputStream();
InputStream in = null;
try {
in = new BufferedInputStream(new FileInputStream(file));
res.setContentLength(in.available());
byte[] buf = new byte[4 * 1024]; // 4K byte buffer
int bytesRead;
while ((bytesRead = in.read(buf)) != -1) {
out.write(buf, 0, bytesRead);
}
if (in != null) {
in.close();
}
out.flush();
out.close();
res.reset();
res.resetBuffer();
} catch (Exception e) {
}
}
public static void downloadFileBlob(Blob blob, HttpServletResponse res,
String filename, String displayFileName) // filename could be
// full path!
throws Exception {
//File file = new File(blob.toString());
String contentType = "";
boolean ifXLSDOC = false;
// res.setContentType(URLConnection.guessContentTypeFromName(filename));
if (filename.toLowerCase().endsWith(".xls")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
}
if (filename.toLowerCase().endsWith(".xlt")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".csv")) {
contentType = "application/vnd.ms-excel";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".doc")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".rtf")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".pdf")) {
contentType = "application/pdf";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".ppt")) {
contentType = "application/ms-powerpoint";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".pot")) {
contentType = "application/ms-powerpoint";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".html")) {
contentType = "text/html";
} else if (filename.toLowerCase().endsWith(".htm")) {
contentType = "text/html";
} else if (filename.toLowerCase().endsWith(".gif")) {
contentType = "image/gif";
} else if (filename.toLowerCase().endsWith(".jpg")) {
contentType = "image/jpeg";
} else if (filename.toLowerCase().endsWith(".jpeg")) {
contentType = "image/jpeg";
} else if (filename.toLowerCase().endsWith(".dot")) {
contentType = "application/msword";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".vsd")) {
contentType = "application/vnd.visio";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".mpp")) {
contentType = "application/vnd.ms-project";
ifXLSDOC = true;
} else if (filename.toLowerCase().endsWith(".zip")) {
contentType = "application/ZIP";
} else if (filename.toLowerCase().endsWith(".txt")) {
contentType = "text/plain";
} else {
contentType = "application/octet-stream";
}
// Set the headers.
res.setContentType(contentType);
if (ifXLSDOC) {
res.addHeader("Content-Disposition", "attachment; filename="
displayFileName);
} else {
res.addHeader("Content-Disposition", "inline; filename="
displayFileName);
}
// Send the file.
OutputStream out = res.getOutputStream();
InputStream in = null;
try {
in = blob.getBinaryStream();
Open Files from Blob or File using SQL and Struts 1
res.setContentLength(in.available());
byte[] buf = new byte[4 * 1024]; // 4K byte buffer
int bytesRead;
while ((bytesRead = in.read(buf)) != -1) {
out.write(buf, 0, bytesRead);
}
if (in != null) {
in.close();
}
out.flush();
out.close();
res.reset();
res.resetBuffer();
} catch (Exception e) {
}
}
}
Are you looking for some Holiday Fun Eyeglasses? Well, Zenni Optical can help. Zenni Optical gives you all the details for each frame so you know what you are getting. You can get new arrivals, half-rim, stainless steel frames, or maybe you want to get the sporty rimless frame with a wide, tapering, two-tone soft temple. You can find a high fashion $ 8 Prescription Zenni Glasses from their website. These are such great prices for anybody looking to purchase some decent frames at a reasonable price. So what are you waiting for? You should check them out now to see which frame you might be interested in.
Read more...This is a Sponsored Post written by me on behalf of Dr. Oetker. All opinions are 100% mine.
This is a Sponsored Post written by me on behalf of Charter. All opinions are 100% mine.

These are some options you can do to optimize your performance using the full text catalog in SQL 2000.
To create the catalog after you have already installed SQL 2000, follow these instructions.
1) Select the full text catalog under the database. Follow the instructions to create a full text catalog. (create a schedule that is incremental)
2) Go to the table that you need a full text catalog created in and select Define full text indexing on a table. The unique index should be the primary key. The column should be the field in the table that contains the document type. The user provides the document type in a column that contains the file name extension that the document would have had if it were stored as a file in the file system.
This is a Sponsored Post written by me on behalf of Hoover and Dirt Devil. All opinions are 100% mine.

This is a Sponsored Post written by me on behalf of Sponsored Tweets. All opinions are 100% mine.

It can be pretty annoying for a user when an application times out. Below is a javascript clock that will inform the user that they have timed out. You can set the timeOut value to a number. The maximum is 60 minutes. The clock will display after 5 minutes and when the user times out, it will change to red.
Timeout clock
Paste this into your head tag on your html page
Place this code where you want the clock to display.
<input type=text style="" readonly name="theTime" size=24>
Put this in your body tag to start the clock when the page is loaded.
onload="javascript:Start()"
Are you looking for a better way to improve iPod and iPhone experience? You should checkout the Yamaha PDX-60 which can allow you to enjoy your iPod and iPhone games, music and movies wirelessly from anywhere in the room. You can get instant connection with no sound delays. You can also charge two separate iPhones or iPods at the same time. I use my iPod all the time but mostly at work. I also enjoy using it when I do physical fitness. I mostly enjoy my iPod to listen to music. What I like about this product is the four color variations to choose from so I can make sure it matches my room. I also like the high sound quality. This PDX-60 uses yAired which is the Yamaha original wireless technology. This technology offers audio and video synchronization and uncompressed wireless audio transmission. This technology is great for people who enjoy watching movies on the iPod or iPhone as well. So what are you waiting for? If you are looking for the best portable player dock for your iPod or iPhone, you need to checkout the PDX-60 today. You can visit their website and read the FAQ for more information. They have a whole list of questions that will help you to understand the PDX-60 even more.

To create a search engine using the SQL Server relevance function:
You are unable to access the system tables in hibernate, but you can use a function in hibernate and have the function access the system tables. Here is what the function could look like:
CREATE FUNCTION dbo.f_getrelevance (@li uniqueidentifier,@relevancestring varchar (80))
RETURNS integer
AS
BEGIN
DECLARE @rank integer
SELECT @rank=KEY_TBL.RANK
FROM dbo.LibraryItemVersions AS FT_TBL
inner join dbo.libraryitems li on li_liguid=liv_liguid
INNER JOIN FREETEXTTABLE(dbo.LibraryItemVersions, Liv_Content,
@relevancestring)
AS KEY_TBL
ON FT_TBL.LIV_verGUID = KEY_TBL.[KEY]
where li_liguid=@li
RETURN ( @rank )
END
You pass in the relevance string and the id associated with the LibraryItem. The LIV_Content is the fulltext field and the LibraryItemVersions is the table.
You will then use a hibernate query and write the query something like this:
SELECT li.LI_title as title,dbo.f_getrelevance(li_liguid,relevanceKeyWord) as Rank
FROM LibraryItemVersions AS liv ON li.LI_liGUID = liv.LIV_liGUID
You are passing in the guid into the relevance function (dbo.f_getrelevance) and the relevance function will return the rank. The relevanceKeyWord is the text that the user has inputted in for this search. You have to remember that the query will crash if the string only contains noise words so you have to check to make sure that the relevanceKeyWord contains more than noise words. A noise word is a word such as and, or, the etc. There is a list of noise words in your SQL server directory. Make sure you SQL Server has already been set up for indexing.
Are you interested in making a child’s wish come true? LeapFish has joined up with the Make-a-Wish foundation to help an ill child’s dream come true. LeapFish will donate 5 cents per tweet to the Make-A-Wish foundation until $10,000 has been raised so the child and their family can go to Disneyland. You should tweet-a-cause to help make a child’s wish come true. This fund raising effort is specifically to help Jacob who is a four year old boy. He has a rare and life-threatening disease that has affected him since birth. His wish is to go to Disneyland. The CEO of LeapFish, Ben Behrouzi, wants to make Jacob’s dream come true. LeapFish an evolved search engine that can help you capture the traditional, multi-media and real-time web through a single connected search platform for both searching and sharing content. This corporation has 100 employees and is privately owned. This corporation is located in Pleasanton, California. The Make-A-Wish foundation is an organization that helps grant wishes to children that are ill. So if you are interested in helping young Jacob fulfill his dream, you should start tweeting today. If you have your own Twitter account, please tweet the following message:
Just tweeted 2 grant a childs wish! #LeapFish donates to #makeawish foundation for each tweet. http://bit.ly/3Tj8A Please retweet!

Are you interested to win some instant cash and prizes? Why not enter the iLASIK Video Contest? The Abbott Medical Optics Inc. (AMO) wants to get information concerning how laser vision correction has improved people's lives. You can make a video showing how your improved vision has improved your life and you could win $5,000 which is the grand prize. AMO has recently launched the “You Gotta See This” to get people to share their experiences. You can submit many types of videos such as boxing and swimming videos. The first prize you could win is a HDTV package which is worth $2,500. The second prize you could win is the Flip UltraHD camcorder which is worth $199.99. Some of the categories you could submit your video under is the “My contacts are getting in the way of my good time” and “My favorite sport or activity would be so much cooler with better vision.” If you need help getting votes, I would suggest getting all of your friends and family members to vote for you. So what are you waiting for? If you have received correction vision and are interested in winning some great cash and prizes, you should checkout the iLASIK video contest today.

The answer is yes. There are many complaints people will make against Java like: it is to slow, Java has memory leaks, Java is too high-level, Java application installation is a nightmare, Java isn't supported on game consoles, and no one uses Java to write real games.
Well, all of those complaints are wrong. Java is pretty close to being the same speed as C++ since Java 1.4. You can resolve any memory leaks by using profiling. Java allows access to the graphics hardware and external devices and many of the rendering for graphics is using OpenGL and DirectX.
The games that were created using Java are: Law and order II, Ultratron, Roboforge, IL-2 Sturmovik, Start Wars Galaxies and many more.
If you are interested in creating games in Java, you might want to use the OpenGL binding for Java called Jogl.