Solved

Search Marathi (Indian) language from JavaDB MS Access

Posted on 2011-02-28
12
667 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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now