aspose file tools
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
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply 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: 19232

Can't you just use a WHERE clause?


SCJP 1.4 - SCJP 6 - SCWCD 5
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: 1098

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: 1098

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: 1098

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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: need help on how to extract specific data from access base into java script
 
Similar Threads
Do a form using Struts.
Help me to have a sortable table in my html profile!
Pass JSTL data via Javascript
struts: JSP, iterator and display a list as a grid
no data in base