Archive for category Miscellaneous
Connect to MS SQL Server using JDBC
Posted by Nalin in Miscellaneous on December 13th, 2008
The following example shows a java class that can be used to verify if you connection to MS SQL Server using JDBC is working properly. The following code establishes a connection to MS SQL server and then executes a query to print system tables. You need to get Microsoft’s JDBC drivers or jTDS JDBC drivers.
import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class ConnectMSSQLServer {    public void dbConnect(String db_connect_string,             String db_userid,             String db_password)    {       try {          Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");          Connection conn = DriverManager.getConnection(db_connect_string,                   db_userid, db_password);          System.out.println("connected");          Statement statement = conn.createStatement();          String queryString = "select * from sysobjects where type='u'";          ResultSet rs = statement.executeQuery(queryString);          while (rs.next()) {             System.out.println(rs.getString(1));          }       } catch (Exception e) {          e.printStackTrace();       }    }    public static void main(String[] args)    {       ConnectMSSQLServer connServer = new ConnectMSSQLServer();       connServer.dbConnect("jdbc:sqlserver://<hostname>", "<user>",                "<password>");    } }
Change <hostname>, <user> and <password> to the correct values. Also, if you use the jTDS drivers, the driver class should be set to net.sourceforge.jtds.jdbc.Driver.
HemingwayEx 0.95 beta
Posted by Nalin in Miscellaneous on March 4th, 2007
I have updated HemingwayEx wordpress theme by adding some simple new features. I also made some bug fixes. The best thing about this update is that now users will see a notification of a new version on the HemingwayEx Option page. I really hope that this works. I am not much of a PHP coder… just hacked up what I could by reading Peter Harkins’s code for the wordpress plug-in Sociable.
I also fixed some more CSS issues with the white.css stylesheet. The worst part about styling a theme is making it compatible with different browsers. I must make my displeasure with IE’s handling of CSS very clear here. I have done what I can for now and will keep fixing things as I learn more.
You can download the latest version, 0.95 beta from HemingwayEx homepage.
If you are UPGRADING, you will need to reset/uninstall the previous version of HemingwayEx first as I have moved the blocks around. If you don’t you might find the display mixed up. Here are the steps you should follow:
- Goto HemingwayEx Options page and note down you settings.
- Now upload the new files for HemingwayEx theme.
- Click reset button right at the bottom of the HemingwayEx options page.
- Refresh the HemingwayEx Options page and set the options to what they were before.
Isreal’s PR Campaign
Posted by Nalin in Miscellaneous on August 11th, 2006
This is a must watch video showing how Isreal and a lot of other factors affect the US Media and hence the view of the people here. I learnt a hell a lot watching this…
Mt Rushmore Trip
Posted by Nalin in Miscellaneous on July 4th, 2006
sucked…
The weather wasn’t all that great… it was really hot during the day and it rained the night when we camped… couldn’t go trekking cause everyone wasn’t ready. Mt Rushmore isn’t that big of a deal… many might not agree with that statement, but I was really disappointed after sitting in a car for 15 hours. Ohh… and the car… it was another experience in itself… Six people with a lot of luggage were packed tightly into a Mercury Mountaineer… On the way back we got a ticket as well…
I guess just because my experience wasn’t all that great (because of the things mentioned above… and many that I can’t mention here), I feel that the weekend was a waste… South Dakota is a nice place… it makes sense passing though SD or staying there over night when you are out on a long road trip. Making a trip to SD, doesn’t make any sense.
Kabhi Kabhi
Posted by Nalin in Miscellaneous on May 11th, 2006
Loved these lyrics… have heard this song many times and few days back was the first time I actually listened to the words… I tend to just enjoy the music and not listen to the lyrics. Beautifully expressed emotions…
Kabhi kabhi mere dil main khayal aata hain
Ki zindagi teri zulfon ki narm chhaon main guzarne pati
to shadab ho bhi sakti thi.
Yeh ranj-o-gham ki siyahi jo dil pe chhayi hain
Teri nazar ki shuaon main kho bhi sakti thi.
Magar yeh ho na saka aur ab ye aalam hain
Ki tu nahin, tera gham teri justjoo bhi nahin.
Guzar rahi hain kuchh iss tarah zindagi jaise,
isse kisi ke sahare ki aarzoo bhi nahin.
Na koi raah, na manzil, na roshni ka suraag
Bhatak rahin hai andheron main zindagi meri.
Inhi andheron main reh jaoonga kabhi kho kar
Main janta hoon meri hum-nafas, magar yoonhi
Kabhi kabhi mere dil main khayal aata hai.
Shadab=fresh,delightful
Ranj=distress,grief
Justjoo=desire
Nafas=breath
Shuaon=light
Update: These lyrics are a simpler version of a sher by Sahir Ludhianavi.
Mad World – Gary Jules
Posted by Nalin in Miscellaneous on May 9th, 2006
This song is by Gary Jules that plays right the end of Donnie Darko. Please… please… do yourself a favor and listen to this song… and also, try to watch this movie…
All around me are familiar faces
Worn out places, Worn out faces
Bright and early for the daily races
Going nowhere, Going nowhere
Their tears are filling up their glasses
No expression, No expression
Hide my head I want to drown my sorrows
No tomorrow, No tomorrow
And I find it kind of funny, I find it kind of sad
These dreams in which I’m dying, Are the best I’ve ever had
I find it hard to tell you, I find it hard to take
When people run in circles its a very very…
Mad World, Mad World
Children waiting for the day they feel good
Happy Birthday, Happy Birthday
And they feel the way that every child should
Sit and listen, Sit and listen
Went to school and I was very nervous
No one knew me, No one knew me
Hello teacher tell me what’s my lesson
Look right through me, Look right through me
And I find it kind of funny, I find it kind of sad
The dreams in which I’m dying, Are the best I’ve ever had
I find it hard to tell you, I find it hard to take
When people run in circles it’s a very very…
Mad World, Mad World
Enlargen your world…
Mad World…
I am…
Posted by Nalin in Miscellaneous on April 10th, 2006
sad… and sleepy….
Deadly combination….
X-(
With or without you by U2
Posted by Nalin in Miscellaneous on December 13th, 2005
See the stone set in your eyes
See the thorn twist in your side
I wait for you
Sleight of hand and twist of fate
On a bed of nails she makes me wait
And I wait without you
With or without you
With or without you
Through the storm we reach the shore
You give it all but I want more
And I’m waiting for you
With or without you
With or without you
I can’t live
With or without you
And you give yourself away
And you give yourself away
And you give
And you give
And you give yourself away
My hands are tied
My body bruised, she’s got me with
Nothing to win and
Nothing left to lose
And you give yourself away
And you give yourself away
And you give
And you give
And you give yourself away
With or without you
With or without you
I can’t live
With or without you
With or without you
With or without you
I can’t live
With or without you
With or without you
(source)
Azureus – Java BitTorrent Client
Get Firefox
Add to Google
Add to My Yahoo!
Recent Comments