File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with table name in mysql

 
mitrship gupta
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1082
Java Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic