This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes need help on how to extract specific data from access base into java script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "need help on how to extract specific data from access base into java script " Watch "need help on how to extract specific data from access base into java script " New topic
Author

need help on how to extract specific data from access base into java script

Milos Markovic
Greenhorn

Joined: Feb 02, 2012
Posts: 4
i have a problem when i want to extract specific data into java scrip page. this code imports all data

<vezbanje_sql_taglib:query var="news" dataSource="jdbcdbc:sajtic">SELECT * FROM country INNER JOIN news ON country.country_id = news.country_id;</vezbanje_sql_taglib:query>
<vezbanje_core_taglib:forEach var="news" items = "${news.rows}">
<tr>
<td align="center">${news.news}</td>
</tr>
</vezbanje_core_taglib:forEach>

but i want to import specific data based in it's country_id for example country_id 1, does anybody knows how i could do that?

for reward i am giving receipt for my girlfriends famous pancakes, believe me they are the best pancakes in the world
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19654
    
  18

Can't you just use a WHERE clause?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Milos Markovic
Greenhorn

Joined: Feb 02, 2012
Posts: 4
i tried something like this

<vezbanje_sql_taglib:query var="news" dataSource="jdbcdbc:sajtic">SELECT * FROM country INNER JOIN news ON country.country_id = news.country_id WHERE ((news.country_id)='${param.country_id1}') ;</vezbanje_sql_taglib:query>
<vezbanje_core_taglib:forEach var="news" items = "${news.rows}">
<tr>
<td align="center">${news.news}</td>
</tr>
</vezbanje_core_taglib:forEach>

but it did not help
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

well step 1 get the correct select statement working directly on the database (squirrel is good if you don't have a database specific tool), then transfer it to your javascript page.
Or if the rows returned isn't the problem, what is it?

Milos Markovic
Greenhorn

Joined: Feb 02, 2012
Posts: 4
sorry but i did not understand you well, could you give me an example code?
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

we can't give you sample code, we don't know your database.
Milos Markovic
Greenhorn

Joined: Feb 02, 2012
Posts: 4
i have uploaded my base, here's link

https://rapidshare.com/files/1643556835/base.mdb

thank you for trying to help me
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

I have no intention of writing this for you.
do you have anyway of running sql against the database which isn't in your web page?
If you don't get one, squirrel is a good free application.

use that to get your sql working.

and I tried something like... is no use, we need to know exactly what you tried.
in a the smallest possibe example program.
 
jQuery in Action, 2nd edition
 
subject: need help on how to extract specific data from access base into java script
 
Similar Threads
struts: JSP, iterator and display a list as a grid
Help me to have a sortable table in my html profile!
Pass JSTL data via Javascript
no data in base
Do a form using Struts.