Similar exceptions are :
1. java.io.IOException: Io exception: Unexpected packet
2. java.sql.SQLException: Protocol violation
3. java.sql.SQLException: Io exception: Bad packet type
4. java.sql.SQLException: Bigger type length than Maximum
5. java.sql.SQLException: Io exception: Invalid Packet Lenght
6. java.sql.SQLException: Closed Connection
7. java.sql.SQLException: Closed Statement
8. java.sql.SQLException: Refcursor value is invalid
9. java.sql.SQLException: Io exception: Size Data Unit (SDU) mismatch
10. java.sql.SQLException: Must be logged on to […]
Entries Tagged as 'Java'
java.sql.SQLException: Io exception: Invalid Packet Lenght
March 9th, 2009 · 1 Comment · Java, Jsp/servlets, Programming
Tags:
java.io.UTFDataFormatException: 5-byte UTF8 encoding not supported.
March 9th, 2009 · 1 Comment · Java, Jsp/servlets, Programming
An interesting exception faced while parsing xml content. Also, on further analysis on this error caused below similar issues started to raise.
Another similar exception is:
java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence
Here, I am trying to parse an xml string using byte array from the xml string, and give that array as input to xml […]
Tags:
Core Java: StringBuffer and StringBuilder
May 15th, 2008 · No Comments · Java
StringBuffer is used to store character strings that will be changed (String objects cannot be changed). It automatically expands as needed. Related classes: String, CharSequence.
StringBuilder was added in Java 5. It is identical in all respects to StringBuffer except that it is not synchronized, which means that if multiple threads are accessing it at […]
Tags:Java·string·stringbuffer·stringbuilder
Core Java: marker interface
May 15th, 2008 · 1 Comment · Java
A marker or tagging interface is an interphase with no methods. It can be created by ANYBODY. the purpose of these interfaces is to create a special type of Object, in such a way that you are restricting the classes that can be cast to it without placing ANY restrictions on the exported methods that […]
Tags:clonable·Java·marker interface·serializable
Building DOM tree by reading an xml file in Java
December 19th, 2007 · No Comments · Java, Source Code
import java.io.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
public class BasicDom {
public static void main(String[] args) {
Document doc = parseXmlFile(”infilename.xml”, false);
}
// Parses an XML file and returns a DOM document.
// If validating is true, the contents is validated against the DTD
// specified in the file.
public static Document parseXmlFile(String filename, boolean validating) {
try {
// Create […]
Tags:
Difference between String str=”abc” and str=new String(”abc”)?
May 25th, 2007 · 1 Comment · Java, Placements
1) using new operator:- String st=new String(”abc”);
2) Without using new operator:- String st=”abc”;
Once string object is created with or without new operator contents of string object cannot be modified. But we can modify String reference variable. when you are trying to modify string objects ie.. concatinating,repalcing etc.. a new […]
Tags:
Reading and Writing Excel Files with POI
April 11th, 2007 · No Comments · Java
In this article we’ll show you how to read and write Excel files and how to read any Microsoft file’s document properties.
Conventions
The POI project is nearing a 2.0 release and is in a stage of rapid development, with new features and changes integrating nightly. In order to keep this article relevant, we’ll refer to […]
Tags:
Java Common Utils: Creating a stored procedure or function in an Oracle Database
February 6th, 2007 · No Comments · Java, Pl/SQL
A stored procedure or function can be created with no parameters, IN parameters, OUT parameters, or IN/OUT parameters. There can be many parameters per stored procedure or function.
An IN parameter is a parameter whose value is passed into a stored procedure/function module. The value of an IN parameter is a constant; it can’t be changed […]
Tags:
Java Common Utils: Calling a Stored Procedure in a Database (Oracle)
February 6th, 2007 · No Comments · Java, Pl/SQL
This example demonstrates how to call stored procedures with IN, OUT, and IN/OUT parameters.
CallableStatement cs;
try {
// Call a procedure with no parameters
cs = connection.prepareCall(”{call myproc}”);
cs.execute();
[…]
Tags:
Java Common Utils: Reading and writing text files
February 5th, 2007 · No Comments · Java
When reading and writing text files :
it is almost always a good idea to use buffering (default size is 8K)
it is often possible to use references to abstract base classes, instead of references to specific concrete classes
there is always a need to pay attention to exceptions (in particular, IOException and FileNotFoundException)
The close method :
always needs […]
Tags:















