aspose file tools*
The moose likes GWT and the fly likes searching email address Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » GWT
Bookmark "searching email address" Watch "searching email address" New topic
Author

searching email address

sudheer yathagiri kumar
Ranch Hand

Joined: Mar 22, 2011
Posts: 35
hi to all,
i have one search box,with in that enter any mail address(contails @ and dot) shoud authanticate and if available in db show the corresponding user details ..this is the case..
for that how to write exacty query to that...by like oprator..
thanks in advance..
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

And how is this question GWT related?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
sudheer yathagiri kumar
Ranch Hand

Joined: Mar 22, 2011
Posts: 35
i am doing that in GWT
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

GWT is a client side framework. You cannot search/fire DB queries directly from GWT.
You will have to validate the user input mail ID and pass it on to the server side using GWT-RPC or any other method of your choice. On the server side, you will need to put in code, which will search the DB for the mail ID.What are you using for your DB?
sudheer yathagiri kumar
Ranch Hand

Joined: Mar 22, 2011
Posts: 35
Yah.i am searching element(se) is passed as a argument to
greetingService.getmobilenumber(se,new AsyncCallback<ArrayList>()
{

@Override
public void onFailure(Throwable caught) {
Window.alert("errror loading database"+caught.getMessage());

}
@Override
public void onSuccess(ArrayList result) {

}
}

i got data as a ArrayList. but while searching for email contains @ and . symbols may not validate or search the email address .... can you help me please ...
thanks
in advance .....
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

I am not really sure what your question is.
Based on what you have posted till now, you already got the DB part solved and you are getting the data back on to the client side. Your problem is identifying which data contains the mail ID. Is this correct?

What is "se"? What does ArrayList result contain? POJOs? Strings?
sudheer yathagiri kumar
Ranch Hand

Joined: Mar 22, 2011
Posts: 35
yah... 1)can you tell what is POJO ?
2) my query in greetingserviceimpl class is
select Name,Mobileno,PAN,Email from MembersTable where Mobileno like '%"+num+"%' or Name like '"+num+"%' or Email like '+"+num+"%'");
its working for Mobileno and PAN but i cont get records when i am entering email address like(sudheer@gmail.com).
I am enter string like this ramesh@ its take as a string na...
i hope you wiill understand my problem.
thanks in advance..
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10451
    
    8

yah.. na..

Please UseRealWords

1)can you tell what is POJO ?

POJO stands for Plain Old Java Object

I had asked this before.
What are you using for your DB?
Since you have chosen not to answer, I cannot help you out more on
...but i cont get records when i am entering email address like(sudheer@gmail.com).
The answer to that problem would be more related to what DB your are using.

As a rule of the thumb, when working with GTW-RPC, one would
1) Invoke a RPC method
2) Arguments, if required, can be passed to this method
3) On the server side, query the DB, retrieve results, construct POJO(s) from the result set
4) Return the POJO(s) to the client
5) Process the data as required on the UI
More info here http://code.google.com/webtoolkit/doc/latest/tutorial/RPC.html

I would recommend dropping the GWT part for now. Write a simple DB code, which will query the DB and retrieve the results. Once you have the proper data you require, you can start building the RPC mechanism to return it to the client.

Please note, we have dedicated JDBC and ORM forums which are the correct place to ask DB/ORM related questions.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: searching email address