• 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

Problem with table name in mysql

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
eat bricks! HA! And here's another one! And a tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic