
Wednesday, December 12, 2007
Strange thing I learned today in java
Strange thing I learned today [12-12-07] is
This code wont works and my yesterday productivity is spoiled by this error
System.out.println("Data 3 from Synonym table: " + rs_synonym.getString(1) );
word[3]=rs_synonym.getString(1);
and I corrected the error by,
word[3]=rs_synonym.getString(1);
System.out.println("Data 3 from Synonym table: " + word[3] );
I modified almost all the parts of the project without thinking about the following reason J
Reason:
rs_synonym.getString(1) takes value out, so again if u assign value from it to word[3] , it will be error.
This code wont works and my yesterday productivity is spoiled by this error
System.out.println("Data 3 from Synonym table: " + rs_synonym.getString(1) );
word[3]=rs_synonym.getString(1);
and I corrected the error by,
word[3]=rs_synonym.getString(1);
System.out.println("Data 3 from Synonym table: " + word[3] );
I modified almost all the parts of the project without thinking about the following reason J
Reason:
rs_synonym.getString(1) takes value out, so again if u assign value from it to word[3] , it will be error.
Thursday, November 22, 2007
Execute Excel Macros from Java application
We are developing a Java Web application and one of our project features require an excel document to be opened over web page. Once the page (with excel) gets opened a macro should be run automatically and a chart should be shown to user.
Best Solution:
~~~~ ~~~~~~~~
since excel macro is vb code, since we can make a vb script file called from java and it calls excel macro
Example:
make a script file as content is
Dim objXL
Set objXL = CreateObject("Excel.Application")
With objXL
.Workbooks.Open ("File_Path")
.Application.Run "Macro_Name"
.Application.Quit
End With
Set objXL = Nothing
and save it as calling.vbs
in java you can call it as Runtime.getRuntime().exec("cmd /c start calling.vbs");
Best Solution:
~~~~ ~~~~~~~~
since excel macro is vb code, since we can make a vb script file called from java and it calls excel macro
Example:
make a script file as content is
Dim objXL
Set objXL = CreateObject("Excel.Application")
With objXL
.Workbooks.Open ("File_Path")
.Application.Run "Macro_Name"
.Application.Quit
End With
Set objXL = Nothing
and save it as calling.vbs
in java you can call it as Runtime.getRuntime().exec("cmd /c start calling.vbs");
Labels:
application,
execute Excel,
from Java,
Macros,
programming
Wedding Query............. (SQL Style)
Wedding Query............. (SQL Style)
CREATE PROCEDURE MyMarriageBridegroom Male (25) ,Bride Female(20) ASBEGINSELECT Bride FROM India_ BridesWHERE Father-In-Law = 'Millionaire' AND Count(Car) > 20 AND House Status ='ThreeStoreyed'AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MBA) AND Having Brothers= Null AND Sisters =Null
SELECT Gold ,Cash,Car,BankBalanceFROM Father-In-Law
UPDATE MyBankAccout SETMyBal = MyBal + FatherInLawBal
UPDATE MyLockerSET MyLockerContents = MyLockerContents + FatherInLawGold
INSERT INTOMyCarShed VALUES('BMW')
END
GO
Then the wife writes the below query:
.
..
.
.
.
..
.
.
.
.
.
..
..
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
DROP HUSBAND;
Commit;
CREATE PROCEDURE MyMarriageBridegroom Male (25) ,Bride Female(20) ASBEGINSELECT Bride FROM India_ BridesWHERE Father-In-Law = 'Millionaire' AND Count(Car) > 20 AND House Status ='ThreeStoreyed'AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MBA) AND Having Brothers= Null AND Sisters =Null
SELECT Gold ,Cash,Car,BankBalanceFROM Father-In-Law
UPDATE MyBankAccout SETMyBal = MyBal + FatherInLawBal
UPDATE MyLockerSET MyLockerContents = MyLockerContents + FatherInLawGold
INSERT INTOMyCarShed VALUES('BMW')
END
GO
Then the wife writes the below query:
.
..
.
.
.
..
.
.
.
.
.
..
..
.
.
..
.
.
.
.
.
.
.
.
.
.
.
.
DROP HUSBAND;
Commit;
Test ur IQ
Subject:1min. Question Paper...try how intelligent u r
R U READY?????????????????????????????????????
R U READY?????????????????????????????????????

Scroll Down for Answer:
.. .. ..
.. ....... .. .. ..
.. .. .. .. .. .. .. .. .. .. ..
.. .. .. .. .. .. ..
.. .. ... .. ..
.. .. ..
.. ..
.
.
..
.
.
..

--------------- Moral: Dont Use your brain too much.
DANGEROUS DRUGS HAVE BEEN GLOBALLY DISCARDED BUT ARE AVAILABLE IN INDIA
Dear All,
Make a Check list, check weather this medicine is in our home or weather it has recommended by our doctor... pls do not use it.. Please Read Very Carefully - INFORM ALL YOUR FRIENDS & FAMILY MEMBERS India has become a dumping ground for banned drugs; also the business for production of banned drugs is booming. Plz make sure that u buy drugs only if prescribed by a doctor(Also, ask which company manufactures it, this would help to ensure that u get what is prescribed at the Drug Store) and that also from a reputed drug store. Not many people know about these banned drugs and consume them causing a lot of damage to themselves. We forward Jokes and other junk all the time. This is far more important. Please Make sure u forward it everyone u know. DANGEROUS DRUGS HAVE BEEN GLOBALLY DISCARDED BUT ARE AVAILABLE IN INDIA . The most common ones are action 500 & Nimulid. PHENYLPROPANOLAMINE: cold and cough. Reason for ban : stroke. Brand name : Vicks Action-500 ________________________________________________________________________ ANALGIN: This is a pain-killer. Reason for ban: Bone marrow depression. Brand name: Novalgin ___________________________________________________________ CISAPRIDE: Acidity, constipation. Reason for ban : irregular heartbeat Brand name : Ciza, Syspride ____________________________________________________________ DROPERIDOL: Anti-depressant. Reason for ban : Irregular heartbeat. Brand name : Droperol ______________________________________________________________ FURAZOLIDONE: Antidiarrhoeal. Reason for ban : Cancer. Brand name : Furoxone, Lomofen _____________________________________________________________ NIMESULIDE: Painkiller, fever. Reason for ban : Liver failure. Brand name : Nise, Nimulid ________________________________________________________________________ NITROFURAZONE: Antibacterial cream. Reason for ban : Cancer. Brand name : Furacin ________________________________________________________________________ PHENOLPHTHALEIN: Laxative. Reason for ban : Cancer. Brand name : Agarol ______________________________ __________________________________________ OXYPHENBUTAZONE: Non-steroidal anti-inflammatory drug. Reason for ban : Bone marrow depression. Brand name : Sioril _______________________________________________________________________ PIPERAZINE: Anti-worms. Reason for ban : Nerve damage. Brand name : Piperazine ________________________________________________________________________ QUINIODOCHLOR: Anti-diarrhoeal. Reason for ban : Damage to sight. Brand name: Enteroquinol
Make a Check list, check weather this medicine is in our home or weather it has recommended by our doctor... pls do not use it.. Please Read Very Carefully - INFORM ALL YOUR FRIENDS & FAMILY MEMBERS India has become a dumping ground for banned drugs; also the business for production of banned drugs is booming. Plz make sure that u buy drugs only if prescribed by a doctor(Also, ask which company manufactures it, this would help to ensure that u get what is prescribed at the Drug Store) and that also from a reputed drug store. Not many people know about these banned drugs and consume them causing a lot of damage to themselves. We forward Jokes and other junk all the time. This is far more important. Please Make sure u forward it everyone u know. DANGEROUS DRUGS HAVE BEEN GLOBALLY DISCARDED BUT ARE AVAILABLE IN INDIA . The most common ones are action 500 & Nimulid. PHENYLPROPANOLAMINE: cold and cough. Reason for ban : stroke. Brand name : Vicks Action-500 ________________________________________________________________________ ANALGIN: This is a pain-killer. Reason for ban: Bone marrow depression. Brand name: Novalgin ___________________________________________________________ CISAPRIDE: Acidity, constipation. Reason for ban : irregular heartbeat Brand name : Ciza, Syspride ____________________________________________________________ DROPERIDOL: Anti-depressant. Reason for ban : Irregular heartbeat. Brand name : Droperol ______________________________________________________________ FURAZOLIDONE: Antidiarrhoeal. Reason for ban : Cancer. Brand name : Furoxone, Lomofen _____________________________________________________________ NIMESULIDE: Painkiller, fever. Reason for ban : Liver failure. Brand name : Nise, Nimulid ________________________________________________________________________ NITROFURAZONE: Antibacterial cream. Reason for ban : Cancer. Brand name : Furacin ________________________________________________________________________ PHENOLPHTHALEIN: Laxative. Reason for ban : Cancer. Brand name : Agarol ______________________________ __________________________________________ OXYPHENBUTAZONE: Non-steroidal anti-inflammatory drug. Reason for ban : Bone marrow depression. Brand name : Sioril _______________________________________________________________________ PIPERAZINE: Anti-worms. Reason for ban : Nerve damage. Brand name : Piperazine ________________________________________________________________________ QUINIODOCHLOR: Anti-diarrhoeal. Reason for ban : Damage to sight. Brand name: Enteroquinol
Labels:
AVAILABLE IN INDIA,
Awareness,
BUT ARE,
DANGEROUS,
DISCARDED,
DRUGS,
HAVE BEEN GLOBALLY,
Medicine
Subscribe to:
Posts (Atom)

