Sunday, July 29, 2012

Inserting BLOB data through JDBC



How to Insert Blob Data into database using JDBC ..
String blobData="My Blob Data String.";
BigDecimal id= BigDecimal.ONE;
String QUERY = "INSERT INTO USER_BLOB(ID, BLOB_DATA) VALUES(?,?) ";
        Connection connection = null;
        PreparedStatement statement = null;
        try{
            connection =  Connections.getDataBaseConnection();
            statement =connection.prepareStatement(QUERY);
            byte[]  blobData =  blobData.getBytes();
            InputStream inputStream = new ByteArrayInputStream(blobData);
            statement.setBinaryStream(1,inputStream, blobData.length);
            statement.setBigDecimal(2,id);
            statement.executeUpdate();
            connection.commit();
        }catch(Exception e){

        }finally {
            statement.close();
            connection.close();
        }

Thursday, May 17, 2012

HowTo Setup VoIP On Your iPhone - SpinVoip using Fring

To Configure Voip Account in Fring do the following steps.

  1. Install fring in iPhone.
  2. Open Fring
  3. Click on More... 
  4. Click Manage add-ons
  5. Open option SIP.
  6. Provide the following details
    1. Username        : username@sip.spinvoip.com
    2. Password        : Enter Password
    3. Proxy Server   : sip.spinvoip.com
It will enable you to setup SpinVoip over Fring or any other Voip.

I am getting wonderful clarity on sound with small delays. I fell SpinVoip is an Average Voip providers.

Thanks for reading.
Asker Ali M

Tuesday, April 10, 2012

The 90% : The unpleasant truth: 90 percent Indians are fools by Markandey Katju

The unpleasant truth: 90 per cent of Indians are fools
Someone asked me, “Justice Katju, you say you wish to keep away from controversies, but why is it that controversies keep chasing you?” I replied that while it is true that I wish to be uncontroversial, I have a great defect: I cannot remain silent when I see my country going downhill. Even if others are deaf and dumb, I am not. So I will speak out. As Faiz said: “Bol ki lab azad hain tere/ Bol zubaan ab tak teri hai.”
In our shastras it is written: “Satyam bruyat, priyam bruyat, na bruyat satyam apriyam.” It means, “Speak the truth, speak the pleasant, but do not speak the unpleasant truth.” I wish to rectify this. The country’s situation today requires that we say “Bruyat satyam apriyam”, i.e. “Speak the unpleasant truth”.
When I said that 90 per cent Indians are fools I spoke an unpleasant truth. The truth is that the minds of 90 per cent Indians are full of casteism, communalism, superstition. Consider the following:
First, when our people go to vote in elections, 90 per cent vote on the basis of caste or community, not the merits of the candidate. That is why Phoolan Devi, a known dacoit-cum-murderer, was elected to Parliament — because she belonged to a backward caste that had a large number of voters in that constituency. Vote banks are on the basis of caste and community, which are manipulated by unscrupulous politicians and others.
Second, 90 per cent Indians believe in astrology, which is pure superstition and humbug. Even a little common sense tells us that the movements of stars and planets have nothing to do with our lives. Yet, TV channels showing astrology have high TRP ratings.
Third, cricket has been turned into a religion by our corporatised media, and most people lap it up like opium. The real problems facing 80 per cent of the people are socio-economic — poverty, unemployment, malnourishment, price rise, lack of healthcare, education, housing etc. But the media sidelines or minimises these real issues, and gives the impression that the real issues are the lives of film stars, fashion, cricket, etc. When Rahul Dravid retired, the media depicted it as a great misfortune for the country, and when Sachin Tendulkar scored his 100th century it was depicted as a great achievement for India. Day after day, the media kept harping on this, whereas the issues of a quarter of a million farmers’ suicides and 47 per cent Indian children being malnourished were sidelined.
Fourth, I had criticised the media hype around Dev Anand’s death at a time when 47 farmers in India were committing suicide on an average every day for the last 15 years. A section of the media attacked me for doing so, but I reiterate that I see no justification for the high publicity given by the media to this event for several days. In my opinion, Dev Anand’s films transported the minds of poor people to a world of make-believe, like a hill station where Dev Anand was romancing some girl. This gave relief for a couple of hours to the viewers from their lives of drudgery. Such films, to my mind, serve no social purpose, but act instead like a drug or alcohol to send the viewer temporarily from his miserable existence to a beautiful world of tinsel.
Finally, during the recent Anna Hazare agitation in Delhi, the media hyped the event as a solution to the problem of corruption. In reality it was, as Shakespeare said in Macbeth, “...a tale/ Told by an idiot, full of sound and fury,/ Signifying nothing”. (In an earlier piece in this paper, ‘Recreating Frankenstein’s monster’, IE, March 31, I had said, “The Lokpal Bill will create a parallel bureaucracy, which will turn into Frankenstein’s monster.”) At that time, if anyone had raised any logical questions, he would have been denounced as a “gaddar” or “deshdrohi”. The people who collected at Jantar Mantar or the Ramlila grounds displayed a mob mentality that has been accurately described by Shakespeare in Julius Caesar.
After Caesar’s murder, Mark Antony stirred up the Roman mob, which went around seeking revenge on the conspirators. One of the conspirators was named Cinna. The mob caught hold of another man, also named Cinna, who protested that he was Cinna the poet and not Cinna the conspirator. Despite his protests, the mob said, “tear him for his bad verses”, and lynched him.
The Jan Lokpal Bill 2011 defines an act of corruption as punishable under Chapter IX of the Indian Penal Code or under the Prevention of Corruption Act vide Section 2(e). Section 6(a) of the bill says the Lokpal will exercise superintendence over investigation of acts of corruption, and section 6(c) empowers the Lokpal to punish acts of corruption after giving a hearing. Section 6(e) authorises the Lokpal to initiate prosecution, and section 6(f) authorises him to ensure proper prosecution. Section 6(i)(j) authorises him to receive complaints.
Section 2(c) of the Prevention of Corruption Act defines a public servant very widely. It includes not only government servants but also a host of other categories, such as employees of a local body, judges, certain office-bearers of some cooperative societies, officials of Service Commission or Board, and vice chancellors and teachers in universities.
As pointed out in ‘Recreating Frankenstein’s monster’, there are about 55 lakh government employees (13 lakh in the Railways alone). There will be several lakhs more in other categories coming under the definition of public servant according to the Prevention of Corruption Act. Obviously, one person cannot supervise and decide on presumably millions of complaints pouring in against them. Hence, thousands of Lokpals, maybe 50,000 or more, will have to be appointed. They will have to be given salaries, offices, staff, etc. Considering the low level of morality prevailing in India, we can be fairly certain that most of them will become blackmailers. It will create a parallel bureaucracy, which in one stroke will double the corruption in the country. And who will guard these Praetorian Guards? A body of Super Lokpals?
All this was not rationally analysed. Instead, the hysterical mob that gathered in Jantar Mantar and Ramlila grounds in Delhi thought that corruption would be ended by shouting “Bharat Mata ki Jai” and “Inquilab Zindabad”.
It is time Indians woke up to all this. When I called 90 per cent of them fools my intention was not to harm them, rather it was just the contrary. I want to see Indians prosper, I want poverty and unemployment abolished, I want the standard of living of the 80 per cent poor Indians to rise so that they get decent lives.
But this is possible when their mindset changes, when their minds are rid of casteism, communalism and superstition, and they become scientific and modern.
By being modern, I do not mean wearing a nice suit or a beautiful sari or skirt. Being modern means having a modern mind, which means a rational mind, a logical mind, a questioning mind, a scientific mind. At one time, India led the world in science and technology (see my article “Sanskrit as a language of Science” on kgfindia.com). That was because our scientific ancestors, like Aryabhata, Brahmagupta, Sushruta, Charaka etc, questioned everything. However, we subsequently took the unscientific path of superstition and empty ritual, which has led us to disaster. Today we are far behind the West in science and technology.
The worst thing in life is poverty, and 80 per cent of our people are poor. To abolish poverty, we need to spread the scientific outlook to every nook and corner of our country. It is only then that India will shine. And until that happens, the vast majority of our people will continue to be taken for a ride.
The writer, a former judge of the Supreme Court, is chairman of the Press Council, express@expressindia.com