Janine Dalton

Greenhorn
+ Follow
since Jan 25, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Janine Dalton

my hosting setup:
tomcat 4.1, jdk 1.4.2, mysql 3.23, mysql-connector-java-3.0.9-stable-bin.jar, (plesk 6, Apache 2.0)
error message:
java.sql.SQLException: Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.net.SocketPermission localhost resolve)
basically, i have just joined up with a new host and am trying to get quite a simple web app up and running. i have to upload my app as a war file and i have tried to follow the required structure and web.xml format.
i have placed the jar file for connector j in web-inf/lib but have not referred to this in the web.xml file - is that where i'm goin wrong? if so, what should go in the web.xml file about connector j?
i'm really not sure what is causing this problem: my knowledge of servlets is limited and i am new to war files. i know my database username and password is correct since i have tested connecting via a php script. my host won't help me get set up at all (unless i pay 75 bucks an hour to their java expert) so i thought i would try the friendly folk here first
im only trying to run one simple college project but i just can't get up adn running adn it's doing my head in

*any* advice would be greatly appreciated!
here is my web.xml file in case it helps:
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Bookstore</display-name>
<servlet>
<servlet-name>Home</servlet-name>
<servlet-class>Home</servlet-class>
</servlet>
<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>Login</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Home</servlet-name>
<url-pattern>/Home</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/Login</url-pattern>
</servlet-mapping>
</web-app>
Thanks a lot Mark,
That's just what I need and that pseudo code looked very familiar, probably because I have used something similar in quite a few programs in the past!!! I think I've been spending far too much time staring at computer screens lately
Hi Mark,
Thanks for replying. Your example is exactly what I want to do but I'm afraid I can't see the "simple looping logic" required! Could you possibly elaborate a little?
while(rs.next()) is about my level
I am using a mysql database for a bookshop project i am working on. I am trying to run a select query to retrieve a list of book ISBNs, titles and authors that meet certain criteria.
My problem is this: I have set my database up so that there is a many to many relationship between authors and books, so I have 3 tables:
Books
-----
ISBN
Title
etc
Authors
-------
Author_ID
Forename
Surname
Books_Authors
-------------
ISBN
Author_ID
Now, when I run a select query like SELECT Books.ISBN, title, Forename, Surname FROM Books,Authors,Books_Authors WHERE Books.ISBN=Books_Authors.ISBN AND Authors.Author_ID=Books_Authors.Author_ID, I get all the information I need, but of course if a book has multiple authors, there are multiple rows in the result set.
When looping through the result set, I basically want to get each book's details and its authors and display them as *one* record for each book.
How can I tell whether the row I am processing is a "new book" or just contains details on another author for the previous book?
Or, would I be better off doing one query to get the list of ISBNs and titles etc and then for each ISBN retrieved, do a separate query to find the relevant author(s) for that ISBN? That seems a simpler approach to a newbie like me, but something tells me that using a whole load of queries instead of 1 is very inefficient!
Any advice would be greatly appreciated...