Saturday, June 23, 2007

J2ME Custom Item

Recently i came to know a tremendous thing of J2ME. I worked little on J2ME. I wanted to make a scrollable textbox which can be appended to a form. So i searched then net and came to know a great thing named Custom Item. This is such an item which you build by yourself and you can add this item to a form. This items have their own paint() method. So you can customize it's look and feel too. The limitation is you can only use it in MIDP 2.0 profiled devices. But it's nice to make one of your own :D. I think J2ME polish uses custom items to change the look and feel of their items.

 

This links are just great. You can see if u want to learn Custom Item

http://www.ibm.com/developerworks/wireless/library/wi-developui/

http://developers.sun.com/mobility/midp/ttips/customitem/

http://www.google.com/search?hl=en&q=j2me+custom+item&btnG=Google+Search

http://safari.ciscopress.com/9780321463425/ch10

I was trying to connect to an ms access database using JDBC. Am a bad learner so it took a lot of time for me to finish it. After googling i found some code to work with java and access. Some of the code is shown below

 

import java.sql.*;

 

try {
        System.out.println("Begining conn");
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String filename = "c:/nsu.mdb";
            String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
            database+= filename.trim() + ";PWD=test}"; // add on to the end
            // now we can get the connection from the DriverManager
            Connection con = DriverManager.getConnection( database ,"shimul","test"); 
         Statement stmt = con.createStatement();
        System.out.println("Conn done succesfully");
        stmt.execute("select * from t");
        
         ResultSet rs = stmt.getResultSet(); // get any Resultt that came from our query
         if (rs != null)
          while ( rs.next() ){
              System.out.println("Name: " + rs.getString("a") + " ID: "+rs.getString("b"));
          }
          stmt.close();
          con.close();
     }
     catch (Exception err) {
        System.out.println("ERROR: " + err);
     }

 

But i got some error like

java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Record(s) cannot be read; no read permission on 't'.

 

I tried googling but found few result, after a lot of googling i came to know some solutions which was near to this then finally got the solution

 

First open the file in access, give password, then From Tool->Security-> User and Group Permissions -> then select the table and for the admin account give it all kind of access. This will solve your access problems.

 

You can use the above code by changing the statements for insertion deletion update etc. You might have to change the stmt.execute accordingly. Jdbc driver may be required which can be downloaded from sun.java.com . I dont know but mine was already there, new versions of JDK have built in jdbc:odbc support.

Tuesday, June 19, 2007

 this is a sample blog entry from my desktop using the windows live writer. Which helps the users to post blog from PC. You can get the software from here. From here you can post to different blogs. Enjoy :D

Saturday, June 16, 2007

Got a job



Recently got a job, i thought previously that it would be great to get a job, but after getting one i found that it's not that enjoyable. Though getting none is more frustrating than this. But after getting 1 i thought that i just robbed someone else's job, who might need the job more, who is more eligible for the job. I'm not sure about anything. Let's see what happens. One thing i came to know that we have to dream hard, which i can't.


Jaukga pray for me brothers :D

Thursday, April 26, 2007

Prince Of Persia

The prince of persia the greatest game on earth, how can we forget those days when we had no time to sleep no time to dream anything else without the prince, always looking for new ways, new tricks, new combos, new princess(ha ha ha)

We liked that game like hell,many of u tooo

Thursday, March 22, 2007

A journey Ends


Ajke amader BUET life er last din gelo. 2001 e hsc er por 2002 te amader class shuru hoisilo. Er majhe onek kisu hoise, onek din gese, onek bosor gese, onek ghotona hoise, onek durghotona hoise, amader onek friend ke haraisi, abar onek notun notun friend hoise, onek er prem hoise,onek er prem vangse, onek er gpa komse, onek er gpa barse, onek er life ta change hoya gese, onek er shopno shofol hoise, onek er shopno venge gese onek er onek kisu hoise, But amra buet life ta voyanok enjoy kortesilam. Class korar anondo r Exam er voy shob e chilo. Abar PL er moddhe shobai mile porashuna, cinema dekha, adda deya khube mojar silo. Amra bujhtei pari nai je kotogula din choila gese. Din gula je kivabe jay kisui bojha jay na.
Mone hoy je matro koyekdin age buet e dhuklam, Kemne je time ta gelo. Khub e arame silam, Ekhon abar job khujte hobe. Vablei kharap lage, Shob bondhu gula ke koi jabe jani na.
Abar kobe dekha hobe tar nai thik, But i really will miss this life, Everybody of Us will miss this life, this was the amazing stage of our life. We shared out thoughts we shared our loves, we shared our hates, we shared everything , But still a lot of things of us are still hidden, Kotota poth perole bolo pothik chena jay??
Jai hok i will miss everything, Kono shundori ke dekhe tar dike bokar moto cheye thaka, kono shundor couple ke dekhle mone dukkho jaga, kauke tease kora, kono friend ke bash deya abar kokhon o bash khawa, All were life. Shohid minar e boisha thaka, Rat dupur e boxshi bazar e khaite jawa, Full volume e gan saira nacha nachi,Mobile e kono meyer shathe faizlami kora,Abar faizlami korar pore tar premik er hate jhari khawa,Class er fake toilet e biri khawa,Kimba cormochari canteen e khawa, Kimba alam's er shamne cha birir adda,Hall er mathe boshe moner dukkho bola, Kimba kokhona ba out of mind hoye jawa, aro koto kiiiiiii, all were life. Shomoy eto druto jay keno??????

Mon ta khube kharap.Jibon er ekta shundro part shesh hoye gelo, Another journey will now begin, Some of us will become great, amra kokhon o onnoder shamne gorbo kore bolbo dekh eita amar friend silo, Ore ami ekdin ekta mair disilam or ore ami ek cup cha khawaisilam, Kimbar or shathe amar ekta chobi ase, Abar kokhon o mone mone hoyto mon kharap korbo nijeke boro der majhe na pawar dukkhe.

Ashole eigula kono bepar na, Everybody will miss it, Amar lekha ta khub e kharp hoya jaitese, ashole abek thakle lekha koshto,

Tobuo mone porbe, gun gun kore gabo, "COffee house er sei addata aj ar nei, kothay harieo gelo shonali bikel gulo sei".

I love u all my friends. I will miss you. Always and Every time .


Aro onek kisu likhte iccha kortese, ei koy bosor er pura kahini likhte iccha kortese, Thak onek kotha mone thakai valo. Bye, Bondhu valo thakish tora

The poem which left as a comment of this blog tells it all, GURU who was the greatest people of my whole BUET life whom i wish to follow,i feel proud that i met him in BUET.

"Dure Shore Jawa Kono Ek Bondhu k.."

Dekha hobe r?
Hoteo to pare..
Asha rekhe dei buker kotore...

Dekha jodi hoye jai ojuter vire..
Othoba fele asha chena chottore..
Didha vule daak dish hothat sojore..
Daan haate daan Haat-purono adore..
Vashbo dujone mile sritir joaare..

Dekha hobe r?
Hoteo to pare...
Asha rekhe dei buker nibire..

Dekha jodi hoye jai pronoyer ghore..
sosta shopner holde basore..
kingba kolahole-adda-ashore...
vul gulo vule giye hashi ta odhore..
kotha hobe du-jona te mridu-toro shore..

Dekha hobe r?
Hotei to pare...
Asha r hotasha ra buker govire..
Protidin protiraate shohobaash kore..

Monday, February 26, 2007

Boi Mela


Every year in February month, bangladesh er bangla academy te ekushe boi mela hoy. Onek onek boi pawa jay. Sara bosor dhoira writer ra lekhe r boi mela te prokash kore. Onek onek vir hoy. Onek onek boi kena becha hoy. Pray shobai boi melay jay. Even picchi polapain beshi jay . :D .. Amio jai, eibar jawa hoy nai . Boi melar link ta na dile kemon hoy, tai banglaacademy er address