• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Newbie Question - how to use different table

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
javatest seems to be the database name, rather than the table name.
 
Namnai Kidorkar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic