aspose file tools*
The moose likes JDBC and the fly likes Newbie Question - how to use different table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Newbie Question - how to use different table" Watch "Newbie Question - how to use different table" New topic
Author

Newbie Question - how to use different table

Namnai Kidorkar
Greenhorn

Joined: Jul 02, 2005
Posts: 25
I used this tutorial in apache server

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html

everything is working fine. but now, i want to play with it to understand it better. I created a different table and want to use it. I changed all the codes that seems to have a connection but still i get the error message

"Table 'javatest.users' doesn't exist"

obviously javatest was the old table which does not have users. the code is still using this javatest table.

where in the code do i select a different table? is it in server.xml web.xml or in the test.jsp code? which code? please help.
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
The table is specified at the end of the connection string in server.xml:

<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
</parameter>

Where javatest is the name of the table. Also, most servers will let you change the table you are accessing. In mySQL you can use the USING keyword, or put the database name in front of the table name.


http://www.goodercode.com
SCJP 1.4
Yilmaz Mete
Greenhorn

Joined: Dec 23, 2003
Posts: 28
javatest seems to be the database name, rather than the table name.
Namnai Kidorkar
Greenhorn

Joined: Jul 02, 2005
Posts: 25
Kerry Wilson's answer was right on the money. thats what i was looking for but could not figure out.

thanks guys.

btw, i'm trying to learn all those things and currently playing with the mysql scripting (.sql files). is there a good tutorial/site you guys know where i can learn it? thanks in advanced.
 
Consider Paul's rocket mass heater.
 
subject: Newbie Question - how to use different table