JSP/Servlet/MySQL tables

Discussion in 'Java' started by Herman Timmermans, Dec 6, 2003.

  1. NTL World News wrote:

    > Hi,
    >
    > I'm a newbie to Java and MySQL and I'm just beginning to develop a web
    > site using JSP/Servlets/MySQL.
    >
    > Can anybody tell me which Java API I can use to return a list of tables
    > from a MySQL database?
    > After the JSP or Servlet successfully connects to the MySQL database I
    > just want a web page to display the list of tables
    > that exist in the database. In SQL I would use the code "SHOW tables", but
    > how does this translate in Java?
    >
    > Any suggestions will be gratefully received.
    >
    > Kevin
    >
    >
    >

    You should look at JDBC API and look at the DatabaseMetaData object, and in
    your case have a look at the getTables(database,schema,table,types) method.
    The Connector/J JDBC driver for mySQL will ignore the schema parameter.
    Hope this helps,
    Brgds
    Herman
    --
    Suse Linux Professional 8.1 on Athlon 1.1 Ghz 512 Mb
    Anti Spam = remove the "dot" and the "at"
    Registered Linux User #264690
     
    Herman Timmermans, Dec 6, 2003
    #1
    1. Advertising

  2. Hi,

    I'm a newbie to Java and MySQL and I'm just beginning to develop a web
    site using JSP/Servlets/MySQL.

    Can anybody tell me which Java API I can use to return a list of tables
    from a MySQL database?
    After the JSP or Servlet successfully connects to the MySQL database I
    just want a web page to display the list of tables
    that exist in the database. In SQL I would use the code "SHOW tables", but
    how does this translate in Java?

    Any suggestions will be gratefully received.

    Kevin



    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
     
    NTL World News, Dec 6, 2003
    #2
    1. Advertising

  3. Herman Timmermans

    Ashton Guest

    In article <>,
    NTL World News <> wrote:

    > Can anybody tell me which Java API I can use to return a list of tables
    > from a MySQL database?


    Look at the JDBC API. It has a DatabaseMetaData object with a method,
    'getTables'.

    (An example would be "Java Enterprise in a Nutshell, 2nd Ed." page 37.)


    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----
     
    Ashton, Dec 6, 2003
    #3
  4. Thanks for the replies
    That really helps.

    Kevin

    On Sat, 06 Dec 2003 10:08:39 -0000, NTL World News
    <> wrote:

    > Hi,
    >
    > I'm a newbie to Java and MySQL and I'm just beginning to develop a web
    > site using JSP/Servlets/MySQL.
    >
    > Can anybody tell me which Java API I can use to return a list of tables
    > from a MySQL database?
    > After the JSP or Servlet successfully connects to the MySQL database I
    > just want a web page to display the list of tables
    > that exist in the database. In SQL I would use the code "SHOW tables",
    > but how does this translate in Java?
    >
    > Any suggestions will be gratefully received.
    >
    > Kevin
    >
    >
    >




    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
     
    NTL World News, Dec 7, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fadzi Ushewokunze

    jsp/servlet/ejb/mysql

    Fadzi Ushewokunze, Jul 24, 2003, in forum: Java
    Replies:
    3
    Views:
    749
    Karthik A.
    Jul 25, 2003
  2. circuit_breaker
    Replies:
    2
    Views:
    2,016
    Jack Jia
    Apr 4, 2004
  3. KevinRobinson
    Replies:
    1
    Views:
    8,428
    Roedy Green
    Nov 15, 2005
  4. javadev
    Replies:
    5
    Views:
    12,923
    javadev
    Nov 16, 2006
  5. Replies:
    4
    Views:
    789
Loading...

Share This Page