This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes Problem with table name in mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem with table name in mysql" Watch "Problem with table name in mysql" New topic
Author

Problem with table name in mysql

mitrship gupta
Greenhorn

Joined: Jul 25, 2005
Posts: 7
hi
i have a table name 'my pet' with space in between
now i want to get the column name for table using getcolumns
but the result set s not returning any columns

Result set rsColumns = dataBaseMetaData.getColumns(this.getCatalog() , this.getSchema(), `my pet`,null);

help me
thanking in advance
mitrship
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Originally posted by mitrship gupta:

i have a table name 'my pet' with space in between



haven't worked on mysql but still wonder if we can have table name with spaces.


now i want to get the column name for table using getcolumns
but the result set s not returning any columns

Result set rsColumns = dataBaseMetaData.getColumns(this.getCatalog() , this.getSchema(), `my pet`,null);


As far my experience with oracle I remember that database object are in upper case and case-senstive.

1. Try with "MY PET"
2. Alternatively you can use % for table name, It will list all tables, onwords you can check if table name is being picked by code.


Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with table name in mysql
 
Similar Threads
help on SOAP
Java heap out of memory problems
Comparing Temporary table with a huge database
Client/Server passing objects
Displaying things...need help badly!! Please!