Solved

Search Marathi (Indian) language from JavaDB MS Access

Posted on 2011-02-28
12
680 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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 500 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
hibernate example for saving data 19 77
iterator/ListIterator approach 17 55
batch vs regular insert in spring DAO 2 25
activeMQ Queue Messages Enqueued and Messages Dequeued 1 39
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

730 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