Sunday, August 7, 2011

Java DB

public class DB_login {

private Statement st;

public DB_login() {
try {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:1000/login";
Connection con = (Connection) DriverManager.getConnection(url, "root", "kaje");
st = (Statement) con.createStatement();
} catch (ClassNotFoundException e) {
System.out.println("classnotfound");
} catch (SQLException f) {
System.out.println("sqlexception");
}
}

public List openUser() {

ArrayList userlist = new ArrayList();

User tempUser;
try {
ResultSet rs = st.executeQuery("SELECT * from logindet");
while (rs.next()) {
String username = rs.getString("username");
System.out.println(username);
String password = rs.getString("password");
System.out.println(password);
tempUser = new User(username, password);
userlist.add(tempUser);
}
} catch (SQLException e) {
System.out.print("exception1");
}
return userlist;
}
}

Tuesday, December 16, 2008

To send e-mails

please send your e-mails to v.kajen@yahoo.com I expect your advices to improve myself.

A New Experience

Life has been a blend of tranquility and turbulence!
Had taught a few wonderful lessons.
Maybe we should learn more..

Scott Adams is an idiot

Scott Adams is an idiot
I am already an admirer of Scott not just because he created Dilbert and I usually have one book on my table of Dilbert cartoons but because he himself calls himself an idiot in his book "The Dilbert Principle".
Most of his introductory statements are amazingly true and most of us would have experienced that in our workplace as well as out of workplace. Let's look at some of his sentences:
"...I was puzzled, but after careful analysis I have developed a sophisticated theory to explain the existence of this bizarre workplace behavior: People are idiots.
…Including me. Everyone is an idiot, not just the people with low SAT scores. The only difference among us is that we're idiots about different things at different times. No matter how smart you are, you spend much of your day being an idiot...."
"...Idiocy in the modern age isn't an all-encompassing, twenty-four-hour situation for most people. It's a condition that everybody slips into many times a day. Life is just too complicated to be smart all the time."
One of the examples that happened with me today was when I went to the local dominick's store and bought the usual vegetables and other stuff. For billing, went to the self billing station and started passing on the objects with the bar code and used either the item code number pasted on the fruits/vegetables or selected the fruits/vegetables from the menu if item code was not available. Then there was a last item for which neither me nor my wife found the name on the menu. She was saying it is chayote or squash and we didn't find the specific ones after going through the item list in 'C' and 'S'. So we called up the helper by the station and there she came, just turned the vegetable and there was an item code available for it beneath which she entered with quite an amusing face and went away with "you are welcome" signature.
Quite true that I slipped into the "idiocy state" during the billing of only the last item when I was able to smartly avoid the helper for all the previous items.

Thursday, December 11, 2008

Theory of Escapism

There are three ways of dealing with a situation/argument.1.Accept the argument as it comes but it won't be possible in many situations. However it may most positive approach in a others view.2.The way of rejection, negative approach most of the time it gives a way to retain our concepts, but may lead to severe argument or disagreement3.Avoid- without proper ending/arguments, it leaves a room to retain our concepts at the same time causing no disagreements but it may irritate the person who you were dealing with.Having used third method most of the times, it is rather difficult to others to understand me, I am not boasting, but sometimes I feel that I could have used second method. Only the problem is it seems to cause some more stress to mind. Actually I should not have any stress. We will go back into 'philosophy'.Theory of escapism can be developed further
Escapism in acceptance: here we accept some facts eventhough We are not ready to follow them.for example when it comes to religion, utter truths people take up this method i.e concepts are accepted by mind not by the heart
Escapism in rejection ; in other words when people wants to make no disagreements or they are not capable to reject
Escapism in escapism : we are not dealing with at all.may be pretend to be dealing. it is far away...
Why am I talking about all these ? I don't know