Vamsi Pavan’s Place

When curiousity outbursts …..

Entries Tagged as 'Programming'

SQL Loader: Import CSV to Oracle table

June 29th, 2009 · No Comments · Oracle Tech, Pl/SQL

One of the very common task in oracle environment is export/import of CSV files to Oracle database. Export is pretty straight forward as many of oracle clients provide this as standard functionality for any query. But for import, we can do by writing our own scripts using pl/sql or java or .NET or any other […]

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:

MySQL Error Number 1005 Can’t create table ‘.\mydb\#sql-328_45.frm’ (errno: 150)

March 15th, 2009 · 2 Comments · Pl/SQL

If you get this error while trying to create a foreign key, it can
be pretty frustrating. The error about not being able to create a .frm
file seems like it would be some kind of OS file permission error or
something but this is not the case. This error has been reported as a
bug on the MySQL […]

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:

Dealing with newline, \n or even \r in PL/SQL

January 8th, 2009 · No Comments · Pl/SQL, Programming

In my PL/SQL procedure I had to add a text including newline (\n in
java, ascii #10) in a text to be read by a java application. Tried with
the code
l_text := ‘hello\nworld’;
This did not work, the \n character behaves clearly different in PL/SQL than
in Java and only wrote ‘\n’, probably the same as writing a String […]

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: Non supported SQL92 token at position: 1

July 25th, 2008 · No Comments · Oracle Tech, Pl/SQL

Seems like this is very common error in pl/sql programming. I know there are many last minute frustrations just because of this error which is no where related to any logic. This seems to be some format error in the programming language itself.
The error message is:

java.sql.SQLException: Non supported SQL92 token at position: 1
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
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:·

Empty links in javascript

May 28th, 2008 · No Comments · Java Script

Best of way of writing empty links in javascript is
<a href=”javascript:void(0);” onMouseOver=”status=”;return true” onClick=”myPopup();” >
here, due to onMouseOver attribute, it won’t display the link location in the browser status bar. Otherwise, you see the ugly location to “javascript:void(0)” in status bar.

Bookmark it!
These icons link to social bookmarking sites where readers can share and discover 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:·

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

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: