stephen84s 550 Nearly a Posting Virtuoso Featured Poster

First of all let me congratulate you on the amazing indentation technique you follow. I think very few programmers in the world survive today who use your indentation technique ... complete left alignment :P.
I suggest you first learn to indent your code. As long as you are doing these kiddy programs you will not have any problems, but when you start writing code even extending to a couple of hundred lines, you will find yourself completely lost trying to figure out which { belongs to which } or where an if block ends etc.
I think you should seriously follow at least some of the coding conventions mentioned by Sun here while programming in Java.
And please give meaningful names to your variables, the sooner you develop these good habits the better it is for your future programmer self.

Now lets see where the problem is :-

System.out.print("\nPlease insert the first card row and column seperated by a comma.");
r1=Integer.parseInt(a.readLine());

Now here you are asking a User to input a row and column number separated by a comma.
But whatever you receive you are directly passing to the Integer.parseInt() method.
Now let me tell you how exactly readLine() works, From your code I get the impression that you think the readLine() method reads character by character which is wrong it actually returns to you the entire LINE of text which was written, so in your case it would be something …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

well if the problem has been solved it would be appreciated if you mark this thread as solved.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Ok... Now I am going to just assume how you wish the servlet should work, If you have an already registered user, you want to just display "You are a valid user" and if the user is invalid you want to display "Please register !!".

So lets see where you could be going wrong:-

String sql = "select mobileno,password from newuser where mobileno='"+ mobileno + "'and password='"+ password + "' " ;

Now the above query would return you a database record if and only if you got a valid user with correct mobile number and password hitting your servlet.

So instead of while(rs.next()) you should instead opt for if(rs.next()) like this :-

if (rs.next ()) {
  // If we get a record it means the (mobileno & password) 
  // combination is already valid.
  // so just close your statements and do whatever you want
  // for a valid user here.
} else {
  // No records found for user in table, so user is invalid.
  // So put the appropriate message for invalid user and
  // the registration link here
}
javaAddict commented: Nice call +3
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Just a thought, instead of writing each object after serializing one by one to the file, why don't you just serialize the entire ArrayList and write it to a file.
And when you need to add any data to the file, get the ArrayList back from the file, add the object to the ArrayList and serialize this ArrayList overwrite the older file with the file containing the new ArrayList

Alex Edwards commented: A nice idea - Serialize the objects in a collection (though I disagree with using ArrayList in this case @_@ ) +5
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Apparently nobody wants to tutor Computer Science these days.

Same situation here, can always consider teaching CS an option :D .

Alex Edwards commented: Even if I manage to get a Master's/Ph.D, I don't intend to be a real Teacher! It's too hard @_@ +5
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

First thing Amrita is DO NOT CONNECT DIRECTLY TO A DATABASE FROM A JSP.
It is a bad practice to do so. It looks like you are still just studying JSPs, so from the start itself learn how to correctly design you web applications by separating the processing logic and the User Interface. Check this thread by Peter for a good tutorial on how you should go about development is JSPs.
And one more thing please use code tags while posting code, look here for more information.

Note:-
A quick fix exists but I simply will not give it to you cause, you would then just implement the quick fix and skip the rest of the advice.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Your button "output" doesn't work cause you haven't added an ActionListener for it like your JTextField

Also you have just one JButton object named "output" and you are first initializing here :-

output = new JButton ("Convert to Celsius: ");

and then overwriting it a few lines below here:-

output = new JButton ("Convert to Fahrenheit: ");
results_c = new JLabel (" ");

So sort out which initialization do you need.

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Do not perform database connectivity from a JSP directly.
Read this thread first and learn from it on how to organize you web applications, Then ask our help.

peter_budo commented: No need for self-promotion, you do that nicely for me ;) +11
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

my professor would give us a program to write that doesn't use what we have already learned.

But the real question is why do you want to limit yourself to what you have already learned and not go a step ahead of the rest.

As far applications of regular expressions to your problem domain go, they are used to recognize patterns in a string.
eg [A-Za-z] would match single occurrence of any letter in the english alphabet. similarly you can check for occurrences of digits and special characters.
OR you could forget all about them and Ezzaral's and my previous posts and use the normal but ... approach of parsing each character of the String of the text file contents using the charAt() function of the String class and perform each test for Digits/letters individually using the methods like isDigit() etc of the Character class

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Amazing I found the exact problem solved right here and then you may look here and here.

Ezzaral commented: Exactly the answer he needed. +12
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Did you read this forum : http://www.daniweb.com/forums/forum72.html, you could check if anyone there wants someone on a per project basis like as an intern or something

Alex Edwards commented: Good suggestion! =) +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
public static void main( String args[] )
     {
       public String productName;  // product name
       public double number;  // product item number
       public double units;   // number of units in stock
       public double price;   // price per unit
       public double value;   // total value of all units in stock

You use the access specifiers (public,private, protected) only for Class level variables, not for local variables, I suggest you please get a good book and clear out your basics of Java.

Alex Edwards commented: Cut him some slack =P +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Can you suggest some easy reading on concurrency (I like reading in style of Deitel or OReilly books, explanation with plenty of examples to try out)

Well I don't know if this would be an overkill (especially if you just need to start up) but when it comes to concurrency, I liked Java Concurrency in Practice By Brian Goetz

Alex Edwards commented: Indeed, a very good book. +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

I disagree with this article.

The author claims that personal training and experience is far better than simply reading a book.

Without the basis, or knowledge of discrete details brought to you by experts, it's hard to say how far your personal training will go.

I suppose this is an "Eye of the beholder" opinion, but maybe you can understand how I feel with my statement?

-Alex

Well its basically how you look at it and interpret the article. For me it was more like pick up the book (any book) and read it, but do not expect any miracles out of it (as the title Learn XXX in 21 days or 24 hours etc suggests).
From my own experience I have met individuals who feel then if they just attend a course for a couple of days in X language or say System administration or ... , they are going to come out as big shot professionals in that field and thats the one attitude of many beginners this article clearly tries to address. It just says there are no magic bullets, no short cuts, if you want to learn to program you have to burn your hands by writing code from small short programs and gradually grow to a professional.
Another section of the article which I can actually apply to my case is "Talk to other programmers;", This shows the big impact of peer groups.
When I had actually first joined Engineering, I did …

~s.o.s~ commented: Oh, a ATKT kiddo ;-). BTW, well said! +23
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Is there a way to close one frame only?

Check out the dispose() method of the JFrame class.
You can also check this tutorial to learn more about Event Handling in Java.

The second question you mentioned is related to the concept of anonymous inner classes, but if you are beginning in Java then I suggest for now you stick to the method mentioned in The Java Tutorial which is my first link.

And please use [code] tags to post your code. Look here and here for more information of code tags

darkagn commented: Well explained :) +3
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

i am doing a project sms base database managmen system using java. i want to know how to read that sms using java.
this is my college final year project.
this is sale markating project.using sms customer can order gods. i used predefind sms format to do this. normal mobite phone i use for this connecting pc.(as a serial port )

Buddy you really need to learn about your domain, basically what you want is to be able to read incoming messages received via a GSM Modem (and in this case your cell phone-> which internally contains the GSM Modem).
From what I can see it appears to me that you are using AT commands directly to communicate with your GSM modem, this would mean that you will have to write your own code to actually decipher the message from the content you get, in this case I guess you will have to write your own function to do the decoding or you could switch to TEXT mode instead of PDU mode. Look here for more information on that.

However I would actually suggest you use the SMSLib library which will handle these low level tasks for you (so you will not have to manually hit the AT commands).

Also a suggestion, when you are working on a project do a little background work on the technologies you are using so you know what is happening. A simple pointer to the …

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Mark the thread as solved please ... I wanna increase my solved threads count :P

Alex Edwards commented: Well if he forgets to do that, I'll at least give you the rep =P +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Man another *%$#@&* thread on mysql & swing created by kevinpeterson22,
what the hell is your problem ?
When some responds to any of your threads you just do not reply back.
Do you think just cause you are making thread after thread on the same topic some one is going to do your work for you ???

Three threads (Now merged to one by the moderator):-
http://www.daniweb.com/forums/thread142547.html
http://www.daniweb.com/forums/thread142547.html
http://www.daniweb.com/forums/thread142547.html

And you refuse to provide any information on the errors you are encountering.
Basically I am begining to think you just picked up that code from the internet (or some kind soul lend it to you) and you want us to fix it for you.

Alex Edwards commented: XD +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Here you go, this should do the job.

peter_budo commented: Bullseye ! +10
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Do not make duplicate threads. This is the third thread with a similar topic, thats why I gave you the negative mark. You did not even care to respond to the people who tried to help you in the first thread

Alex Edwards commented: Saved me the trouble =P +3
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Here you go, best of luck for your MCA.

javaAddict commented: Good reply +1
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
Alex Edwards commented: Haven't seen you in awhile? =P +3
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Here you go guys, this should have all the features an e-banking project should need.

peter_budo commented: Ouch, somebody nailed that one. Was that you? +9
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Ok fine. I need the code to send SMS.

I am not here to give you ready to eat food, just to help. See the javadocs of OpenSMPP and find your way around.

Can i actually send the sms for free or do i need to signup any contract with sms providers for this

You definitely need to sign up with a provider to send smses. Just search for "bulk sms providers" and you should get a pretty comprehensive list. I am currently not aware of any providers who would allow you to use their service for free (apart from testing their service that is)

Alternatively you can also send messages using the GSM Modem. For that you can check out the SMSLib API, the GSM Modems use a SIM Card which is charged for every SMS you send.

peter_budo commented: Nice post, with good reasons +9
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Now I do not know what to say:

Statement st = null;
ResultSet rs = null;

rs = st.executeQuery("Select description from user ");

Sorry If I sound rude, But do you expect some magic ;) , you are calling the method on an object (st) reference set to NULL, even if the sun doesn't rise tomorrow that code is going to throw a NullPointerException.

peter_budo commented: Sun will rise tomorrow, so there will be NULL +8
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

yes I do, but can I see what you have tried, cause this looks like one of those questions with little practical application and mostly for academic use only ?

ssharish2005 commented: Well said, it is a pratical question. Remeber me doing in the university. haha +2
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

well, y'see... hmmm... okay, i guess i don't really know WTF you're talking about

because to declare an array of chars as either char * myString or a char myString[] is the same effect. in either case, "myString" is a pointer to the address containing the first character of that array of chars.


.

I had the same belief before, but some time ago Radical Edward had informed me in a different thread that (char * and char[]) are equivalent only when used in function declarations (eg void foo(char *abc) is same as void foo(char abc[]) ).

But I guess the link from Dave clears everything.
And I tested the above in GCC 4.1.3

jephthah commented: yeah, you were right... good post +4
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

If you mean use a DLL, then I suggest you take a look at JNI, the Java Native Interface

stephen84s 550 Nearly a Posting Virtuoso Featured Poster

Amazing I found the exact program you needed Here

Nick Evan commented: Duckroll! +6
stephen84s 550 Nearly a Posting Virtuoso Featured Poster

You need to compile C++ programs in GCC using g++ and not gcc.

g++ filename