Solved

Search Marathi (Indian) language from JavaDB MS Access

Posted on 2011-02-28
12
678 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xampp tool 12 56
How  can  i  resolve  HTTP Status 404 -? 8 43
Chrome and Firefox Java 5 51
Java: anonymous class 4 29
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This video teaches viewers about errors in exception handling.

861 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