Archive for the ‘Uncategorized’ Category


This post covers the steps to configure a MySQL datasource in JBoss Application Server 7. This datasource can then be referenced via JNDI to connect your application to the underlying Database. I presume you already have a JBoss AS 7 up and running in your development environment. If not, do that first.

Download the MySQL JDBC database driver

  1. Download the latest JDBC driver for MySQL from http://dev.mysql.com/downloads/connector/j/
  2. Save the downloaded zip file and extract the connector jar.

Add the MySQL connector Driver as a Module in Server

  1. Goto: <JBoss-AS-7-Home>/modules/com
  2. Create folders mysql/main and copy the above downloaded JAR file(mysql-connector-java-5.1.21-bin.jar) in it.
  3. So your folder structure should now look like:<JBoss-AS-7-Home>/modules/com/mysql/main/mysql-connector-java-5.1.21-bin.jar
  4. Now that the Driver/Connector JAR is present, we need to define it for the Application Server.
  5. Goto: <JBoss-AS-7-Home>/modules/com/mysql/main folder where you copied the JAR file and create another file module.xml
  6. Paste the following code into it and save.
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.0" name="com.mysql">
  <resources>
    <resource-root path="mysql-connector-java-5.1.21-bin.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>

Since I’m using mysql-connector-java-5.1.21-bin.jar version so I’ve kept the <resource-root path = “mysql-connector-java-5.1.21-bin.jar”/>  in case you have a different version then give the same in the path attribute above, highlighted in the code-snippet.

Add the Driver reference in the Server

  1. Goto: <JBoss-AS-7-Home>/standalone/configuration/standalone.xml
  2. In the standalone.xml file add the following line in the <drivers> node.
1
<driver name="mysql" module="com.mysql"/>

This configures the support for a MySQL datasource in your JBoss Application server.

If you wish you can add your datasource in the standalone.xml file itself. But I prefer to keep the datasource file in my Application.

Creating the Datasource

  1. Create an xml file your-datasource.xml under your WEB-INF folder.
  2. This is a sample datasource file. my-sample-ds.xml

 

<?xml version="1.0" encoding="UTF-8"?>
 <!-- The datasource is bound into JNDI at this location. We reference
 this in META-INF/persistence.xml -->
 <datasource jndi-name="java:jboss/datasources/your-ds"
 pool-name="sample-pool" enabled="true"
 use-java-context="true" jta="true">
 <connection-url>jdbc:mysql://your-server-address/your-db-name</connection-url>
 <driver>mysql</driver>
 <security>
 <user-name>your-username</user-name>
 <password>your-password</password>
 </security>
 </datasource>
</datasources>

Referencing the datasource in your application

  1. Now that we have everything, we just need to refer this in our application.
  2. We can do this from persistence.xml if you’re using JPA standards.
  3. This is a sample persistence.xml which I keep under META-INF directory
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
 xsi:schemaLocation="
 <persistence-unit name="primary">
 <provider>org.hibernate.ejb.HibernatePersistence</provider>
 <jta-data-source>java:jboss/datasources/your-ds</jta-data-source>
 <exclude-unlisted-classes>false</exclude-unlisted-classes>
 <properties>
 <!-- Properties for Hibernate -->
 <property name="hibernate.show_sql" value="true" />
 <property name="hibernate.hbm2ddl.auto" value="update" />
 <property name="hibernate.use_sql_comments" value="true" />
 <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
</properties>
</persistence-unit>
</persistence>

I used Hibernate above as my default JPA provider.

So this was all about creating and configuring a MySQL datasource in JBoss AS 7.

 

The Little Criminal.

Posted: January 5, 2013 in Uncategorized

tich..tich…tu tu tu…..tishhh…fingers on remote button and with the channels changing on the screen,
On every channel, what irritated me the most was they were showing tv serials related to the crime.

crime patrol,cid,khaternak,mujrim,shaitaan ..what the hell is this where is that creativity gone?or is it that crime is in trend these days
but litreally speaking CID is the most irriatating serial,more then that girl ,who sits beside me in the class ,if for once murder was made legal i would have killed her ..super irritaing and cheater ki bachi,ok leave her here she is not that important that we talk about her,pile of shit huh..

ok so ,what amazed me today is the fact that crime is in trend ,they are showing serials on crime ,politicians are doing crime ,police officers are doing , ok i agree i was the one who ate my warden’s hide n seek,so i am also a little criminal,but the biggest criminal according to me are ? we t people ,i dnt know if i have the right to say this or not,

As i always said , we want heroes,like gandhi ji,bhagat singh,we talk of , that someone need to stand up against these things now..!!. why someone ?
why dont we ourself do something,

i want to stand up,i want to do something,but stand up where? ..if i’ll shout telling people ..comon..guys it’s the time to do something ,they will take me as an idiot ..yes and i wont get support ..yes this is the thought each one of us get when we think of doing such things i also get the same thoughts.

Some time i think we are like remote controls with batteries inserted and one day we have to die just like a cell goes off,why are we fighting and even why we are studying…well this goes for maths..i hate maths and offcourse einstein who did considerable work in maths,
oh my god see me IQ you can easily guess how good i am in studies..i seriously think there should be no schools and colleges but other time ,
most of the time i am glad that i am in college when i am among my relatives coz it’s giving me an opportunity that i can say to dem ..GAVAAR sale,it gives me a feeling wow i am so lucky…

See again i am out of trackkwe were talking about crime and where we are…off course i am not a good writer,but i guess kishore kumar would be proud of me if he was here proud of the fact that i am born in india,well kishore kumar was a writer? …ummmm no i guess he was a photographer..ok but why are we discussing him,he is not a criminal, oh my god i think it’s the time to sleep we’ll continue on this crime thing some other day definately…

thanks

prakshi_astral

Happy new year all!!!

Posted: December 31, 2012 in Uncategorized

Back on Track,so from today and from now on, i am going to write something every day….happy new year to al

To be Continued….!

Posted: September 25, 2012 in Uncategorized

Dont know where to start…
and i dont know when time started ticking and still is,day sets in and sets out i want to stop this moment .
after noon the lights from houses start getting brighter and brighter,and ultimately there is one point when the light from moon seems dull in front of them,but these lights are either from neighbour’s or from street lights,it is always dark for me i love living in dark.

there are there phases of my life
PAST..when i was running away from my friends
PAST PRESENT..when i was running behind friends
PRESENT..when i am left alone

even a casual comment by a passerby seems offending,irritating is the fact that they are happy among themselves.
i am not a admirer but i use to admire the brightness of stars in a dark dull night,they are far away from me but they are my good friends they are my friends in loneliness,i share with them how i feel about my life and others.

i close my eyes and i see myself laughing and everything is covered with a thick white fog,and then my head starts paining,i want to see what is on the other side of that fog or i was laughing at myself?..no it is just the demand of situation mind show us what we want to do..and i just need a good time

continued….thoughts drained off!!..will continue later..


muslims and hindu’s ok give two difference between them.
ok..let us review the wild guesses..
1.they are muslims
2.they are muslims

i dont think that beside these there are any differences among them.they are not different and from centuries ,these hindu ,sikh muslims and chritians been living together and sharing bonds and fighting together for our country.

so where does this root of religion came in between?several questions..and one answer to all the queries
Answer is kinda simple and everyone ,you me all know it but we actually dont want to change things we have the tendency to let things go as they are going .
people whom we choose as our representative for our external affiars ,whom we choose to mantain law and order state of govt.they themselves are doing all this…and that is our minister’s ..

we indians were able to root out the britishers but britishers left some of their instances in our society,such as that old iron bridge of old delhi..the best example i can cite and many other things and like that they left behind some flithy saying’s too.such as “Divide and Rule” .India was celebrating  its indepedence and some minds were plannning to once again rule over people using same technique that britishers used ,at that time they exploited our religions they seprated the wings away from the golden bird and she was there lying helpless and wings seperated apart in pakistan .

right now i dont have any more thoughts other than the strange feeling that why?? why??….i can understand the fact that god is one ,and religion is nothing but one’s way of greeting god,why people can’t understand it ..may be this the reason why i think education play a very vital role teaching the society,but education too emerged as an industry of making money and people are earnig well from it ,

what were some moral rules  i learnt..
Soldier die for country,
minister live for peace ,
police for safety,
policies for honsety,and teachers to the benefit of society..

now soldiers die in country..,ministers live for there piece.(money),police for their own well good and policies are made by corrupts and teachers for their own benefits to earn and to survive

i am convinced and i beleive that each person believe and worship tht supreme power in their own style ..!!.

One more issue i noticed when some foreigner speaks something wrong about india…that feeling of love towards country started showing it colours but when we are back in our conutries we start fighting amongst each other …

i strongly condemned the quote “charity begins at home”..to some aspects it meant wrong to me ….till now i was following this thing ,charity is meant to be with society,your family and with motherland ..so lets do something good everyday…and respect every religion!!

Nice Speech Good Bye..
prakshi_astral

I am not strong??!!!!

Posted: September 16, 2012 in Uncategorized

12 september,2012 

sun rises from east,and sets up in west.god is one,and like this there are lots of stuff which we regard as universal truth,and one more truth that is going to be added in that unending list is the fact that i am a very lazy person and i wake up late in the morning…well that is not a big deal,most of us are lazy…but dad proudly says that one day i am going to break all the records in laziness.

Sweet Miniature tune ,in the alarm clock started playing in alarm clock slowly and sweetly,and after a while it started out loudly as if it’s shouting at me .excuse me ? did i said it started shouting at me …?…actually nobody got the guts to shout at me not even my dad i am a princess!!.

i just stepped out of bed and eyes were not stable ,my feets were reaching towards  chappal and suddenly phone started ringing ..my heart beats started pumping vigourously as if attacked by a two head cow,mostly seen at Dream road,prakshinager,mind number -420 near pupil (in short in my dreams).

i picked up my phone and it was pooja on the other side.
hey..hi…Good morning..i greeted her lightly
it’s 3pm by the way..” pooja replied as if i dont know how to see time in clocks,
hmm..is this pm manmohan singh??“.
see ,actually we all are at simran place ,and her father met with an accident and condition is serious.“..

Everybody knew how media and movie affect out mind in our lifes best example is the influence of the western culture on our lives but may be this whole thing affetced me the most,at that very instant on phone ,i went back into the flash backs and ..i questioned pooja the way they did in some serial on TV..
“haww?? how ? what? when?” . 
“this is a tough time for simran,i thought of informing you about  this,since you two are good friends,come over to her place we are waiting for you..”and then she hunged up.

i just got dressed up ,didn’t cared about anything..no breakfast,no bread butter nothing..i just rushed down the stairs towards parking ,while i was driving i thought to myself what if i get tears in my eye?..no i am very strong i will not cry,i will handle the situation,everything will be alright.

it took me about 30 minutes ,and i was there.Just as i arrived her place,i saw an ambulance coming …
May be her dad’s health was good now and ambulance was bringing him home ..several doubts,and questions

i looked at the faces of other ladies from the neighbouhood ,they were gossiping with each other and there was sitting simran among other friends and i can see a big question mark on her face…”What happened to her dad? is everything alright or not?”..may be more questions than those running in my mind .

Ambulance stopped in the front of their house,two people from the ambulance got down and open the ambulance door and there was a stretcher with a white big bag on it!!. there was also one black honda city which was just following that ambulance ,people got out from the car and they were crying with their mouths open and loudly.That white bag was…simran’s dad..
questions were answered,but i didnot wanted it that way

He was no more. simran came running towards the stretcher with tears in her eyes i looked at her face ..i looked at her mother face they were crying and while people were carrying her dad into the house she hold my hand tightly”dekh prakshi dad ko kya ho gaya !! “.i looked at her face all those filmy thoughts everything vanished i couldnot stop my eyes from getting wet.

mat ro ,sab theek ho jayega ,mein ho na tere sath mein dhyan rakhungi tera“,i wanted to say this but my words did not come out i hold her tightly she was very cold ,i was crying and i was not strong anymore.

That day i realised the importance of parents ,dad i will never speak rudely with you,and mom i love you too.but simran lost her dad .we are helpless we can not help her in this except that we can show her some sympathy,some wounds take weeks to get healed ,but these are for life time .

May god bless her dad’s soul

Answer me plzzz..

Posted: September 13, 2012 in Uncategorized

So here are some questions ,my friend asked me ..in general..he actually pleaded me to answer these so here is the list along with answers..

What are you afriad of ??

i am not afraod of anything …not even god..but the thing haunts me the most is …the feeling that …there might be some bogie man sitting under my bed and he is going to capture my soul this night

Otherthen your family whom do you dislike most ??????
other than my family ..hmm actually i never thought about it but in case if i am asked ..so i wud be saying,,i have a strong feeling of dislike for all those who answer in the class giving me a feeling that i am still in my learning FACE..

why you dont want to be the PM of India ???
who said ?? i dont wanna be the pm?…actually i think i can be a good leader ,if given a chance i will pass a rule …that classrooms are to be conducted in the canteen itself .and would affialate all the colleges as IIM..so tht..janta bhi khush aur ham bhi khush

If forced, what you will be in the next birth and why ?? choose from the option(pig,snake,hyena,crocodile,mosqyito cockroach)
reading this question,,my mind started ..compiling it …thoughts started running into my mind…i started comparing human beings to a everady battery….oops…compiling still going on…oops…network lost!!..may be some hardware problems..

which villain you find most terrifying ???
villain umm….Minister’s..i love the way they ue to loot the public,and i specially admire their sense of humour and promises…it appears as some 70’s cinema going on..
“BASTI WALO….mantri ji elaan karte h ..election ke baad sabko 1 ghar ke sath bijli pani muft..”..in reality there is condition apply on all the announcments made by them..and wait may be next time ill name my dad ..he wakes me up in the morning when i am in middle of some good dream

Aaj tak aapne kya khoya he ??
neend…ji ha…everyone is running after money..exams..love..and i am sitting at my place and looking at the whole scenarios the whole time and it’s like i can not sleep…sukh chainn cheen liya h is competetion ne

why you have to answer the stupid questions like this???
becausce i love to tell people about me how i feel,i love sharing my views ..although people are not intersted in listening to things i cook..

agar darna mana he hai lekin dar k aage jeet hai toh jeet k aage kya hai ??
Any comments ?? If no why not??
hmmm..ager dar ke agey jeet h to jeet ke agey bhi ek shop hai actually jeet ek restro ka naam bhi h…and sorry..i dont know what is dar..i tried finding it in my distionary but i think somebody tore that page…oh shit …i was searching in a english dictionary..and xcuse me how dare you think i am not gonna comment on this silly question? you know i have been arguing on silly topics like whether you have a brain..though this one was a tough call

OVER