This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes How to get MSAccess SQL Query using Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to get MSAccess SQL Query using Java" Watch "How to get MSAccess SQL Query using Java" New topic
Author

How to get MSAccess SQL Query using Java

Venkatesh Rajendran
Ranch Hand

Joined: May 17, 2001
Posts: 59
Hi All,
I have one doubt. is it possible to get MSAccess query using java? is there any other method to get the same?
Detail: I have created one query using query wizard.now i want to retrieve the query using Java. is it possible?
Thanks in advance.
Venkat
kichu kichu
Ranch Hand

Joined: May 10, 2001
Posts: 59
Hai,
Do u mean whether u can access msaccess data using java???Is that your question??
If yes ,this can be done using getconnection.
Get back to me and i will post the code.
regards,
kichu
Venkatesh Rajendran
Ranch Hand

Joined: May 17, 2001
Posts: 59
Thank you Mr.Kichu
I will explain my situation detaily then you can understand easily. Actually we will have tables,forms,queries,reports etc., will be there in one mdb file right. In that mdb file i have one table called emp and i have query called qryemp in that query i have written select * from emp. now i want to access this query from my Java program. is it possible? My ultimate AIM is i don't want to give queries in my Java program b'se if i change any thing in the table or concept i can change it in the query itself i don't want to touch the java code. am i right? then i can call the query using its name.
are you clear now?
thanks in advance.
Venkat
kichu kichu
Ranch Hand

Joined: May 10, 2001
Posts: 59
Hai,
Sorry i have to go from office.But will definitely reply to u tomorrow.
Anyway u have to write query in java,there is no other option.
will send details later,
regards,
kichu
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
You might be able to access your query like a stored procedure, because that's basically what it is. It's what Access uses for stored procedures. I haven't tried this myself, but it's so crazy that it just might work...
edmond so
Greenhorn

Joined: May 17, 2001
Posts: 6
i think access exposes queries as tables. i haven't tried it in java, but that works on asp. simply query the query like a normal table.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get MSAccess SQL Query using Java