Vamsi Pavan’s Place

When curiousity outbursts …..

Entries Tagged as 'Java'

Eclipse: resource is outof sync with the file system - permanent solution

January 29th, 2011 · No Comments · Java, Tools, Windows

Mysteriously got the following exception when trying to build an Eclipse project:
“resource is out of sync with the file system”
Although I can’t be sure, I think I may have deleted a file outside of Eclipse. To fix the problem, right click the project or edited resource […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:··

java.sql.SQLException: Io exception: Invalid Packet Lenght

March 9th, 2009 · 1 Comment · Java, Jsp/servlets, Programming

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 […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

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 […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

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 […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:···

Core Java: marker interface

May 15th, 2008 · 2 Comments · 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 […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:···

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 […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

Difference between String str=”abc” and str=new String(”abc”)?

May 25th, 2007 · 5 Comments · 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 […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags:

Reading and Writing Excel Files with POI

April 11th, 2007 · 3 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 […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

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 […]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

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();

[…]

Bookmark it! These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Live
  • StumbleUpon
  • BlinkList
  • YahooMyWeb
  • NewsVine
  • blogtercimlap
  • Netvouz
  • Technorati
  • Slashdot
  • Print this article!

[Read more →]

Tags: