wood burning stoves*
The moose likes JDBC and the fly likes retrieving from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "retrieving from database" Watch "retrieving from database" New topic
Author

retrieving from database

gaurav chhabra
Ranch Hand

Joined: Jul 24, 2004
Posts: 109
sir ,,,,,,,
i m using MS ACESS and want to retrieve from the database......

ResultSet rs = st.executeQuery("select name from general_information where name ='jai mata di'");

but it is not showing the result properly ....... it is not matching 'jai mata di' in database but when i write only 'gaurav' then it matches and give the proper result.....i think that is is the problem of space.........
please tell me that
thank you
gaurav
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30369
    
150

Gaurav,
Try doing some simpler queries to try to isolate the problem, such as
select name from general_information where name like '%jai%'
select name from general_information where name like '%jai %'


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1131

Gaurav,

i think that is is the problem of space

Do you mean that the problem is because "jai mata di" contains spaces
(which is the way Jeanne understood it, I think)?

If Jeanne's interpretation is correct, then spaces have nothing to do
with it. There simply is no row in the GENERAL_INFORMATION table where
the value of the NAME column is "jai mata di". And if you think there
should be, then you must be mistaken.

However, if you think that there is a NAME that contains "jai mata di", then
Jeanne's query should find it for you.

Good Luck,
Avi.
[ March 03, 2005: Message edited by: Avi Abrami ]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30369
    
150

Avi,
That's exactly what I was thinking about. Thanks for expanding on it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: retrieving from database