This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell 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


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
 
GeeCON Prague 2014
 
subject: Problem with table name in mysql