Improve company productivity with a Business Account.Sign Up

x
?
Solved

Search Marathi (Indian) language from JavaDB MS Access

Posted on 2011-02-28
12
Medium Priority
?
709 Views
Last Modified: 2012-05-11
I have develop java application in Marathi I inserted some record in database but at the time of searching it’s not responding I used JtextField for search by name I used auto complete method in query  like “select * from employee where name =?%” but I am not getting any record  Please help
0
Comment
Question by:Aurii
  • 5
  • 4
  • 3
12 Comments
 
LVL 47

Expert Comment

by:for_yan
ID: 34999194

Sorry, just to make sure, that you have correct syntax with the query; your example with % doesn'ty look
familiar to me; it should rather be

select * from employee where name like '...%'  

where ... - is the substring you are looking for
- so
when you use percent sign it should be "like" not "=" and single quotes are normal in SQL for strings.
Question mak will be used only in PreparedStatement.
Just making sure the issue is not something related just to appropriate syntax.

I'm more accustomed to Oracle rather than MS Access, but I think those syntax points
are the same for any SQL

 
0
 

Author Comment

by:Aurii
ID: 35004619
Yes, you are right. Actually by mistakenly I wrote wrong statement. My query is,
“select * from employee where name  like '?%'  ”
Now suggest me solution
0
 

Author Comment

by:Aurii
ID: 35004642
I am using ISM V6 software for my Marathi font (It supports Unicode). When I Saved String in database by my java application it get saved in database as garbage value. At the time of retrieval It showing right value but at the time of searching like I mentioned above, Its' not responding.
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
LVL 47

Expert Comment

by:for_yan
ID: 35004662
But what do you mans by this question mark inside teh quote? Should not your provide
the value for it before querying, what substring you are looking for?
Does your query return at SQL prompt outside your code?
0
 

Author Comment

by:Aurii
ID: 35005406
For example my database contains lot of names and I want to show only those names whose starting character is "S". For the same I wrote query,
“select * from employee where name  like 'S%'  ”
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35005426
Yes, this query does makes full sense.  So it does not return from your java code.
Does it return directly from SQL prompt?  
0
 
LVL 92

Expert Comment

by:objects
ID: 35005486
> “select * from employee where name  like '?%'  ”

(assuming you are using a PreparedStatement) that should be:


“select * from employee where name  like ?”

and include the % when you set the parameter
0
 

Author Comment

by:Aurii
ID: 35005521
I am using MS Access. This query successfully worked for English font but its' not working for ISM Marathi font. I am not directly writing 'S' in query. I used one JTextFeild named 'name'' for such operation.
I set keyReleased event on that TextField. In that I wrote above Statement as,
“select * from employee where name  like ' "+name.getText()+"%'  ”
And then I set results of this query in my JTable
0
 
LVL 47

Expert Comment

by:for_yan
ID: 35005543
Well, one thing you print
System.out.println(“select * from employee where name  like ' "+name.getText()+"%' ");
just before your queriyng in the program - so you'll know that
your textfiled provides you wit reasonable string.
Another thing when you see this query as it is printed, go to the database
sql prompt ot in your case to MS Access itself - and run your query
exactly as you see it printed directly on the database - you'd at least get some
knowledge wheteher the problem is in the database itself or
in the interaction with your java code.  This wil probably not solve your question, but
would at least allow to compartmentalize your problem.
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 35005614
sorry misunderstood
the access driver does not support UTF-16, thats most likely your problem
0
 

Author Comment

by:Aurii
ID: 35006740
My query is right. I checked it. It worked properly fpr English font. Its' showing problem in application which I developed in Marathi. If my database contain name 'harry' and if I type some intial characters then it is not showing any result but if I type full name 'harry' then its' showing result. I am using ISM V6 for Marathi font which is Unicode and 64 bit. And my datatype is 'Text' which of size 255. Is this  mismatched combination? If yes then please suggest me any solution because I thought Its' problem of datatype in database. MS Access does not have Nvarchar datatype
0
 
LVL 92

Assisted Solution

by:objects
objects earned 2000 total points
ID: 35012240
the only solution is to try java7 to see if they have added utf-16 support
currently java only really supports english queries with access
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question