• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

retrieving from database

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author & internet detective
Posts: 40211
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 %'
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Posts: 40211
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Avi,
That's exactly what I was thinking about. Thanks for expanding on it.
 
My pie came with a little toothpic holding up this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic