Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How would I do a all-round searching for all tables of the database?

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say I type in "Hello" in a textfield,
Everything associated with hello in my database will pop up,
Just like the search bar of windows 7
I am doing it in Java + MariaDB. Thanks
Jack
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jacky Luk wrote:Say I type in "Hello" in a textfield,
Everything associated with hello in my database will pop up,
Just like the search bar of windows 7
I am doing it in Java + MariaDB. Thanks
Jack



I have discovered this on the web


I right clicked on the create context menu bar of mariaDB, then select create stored procedure and paste this into the pane,
but it says there is syntax error near "proc"
Thanks
Jack
 
Rob Spoor
Sheriff
Pie
Posts: 20753
68
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java, you can retrieve all tables names using the JDBC API:
This code includes using the identifier quote string. For some database servers this is ", for some `, in your case it's probably '.

You can then use simple SELECT queries in JDBC to check for the data. Just do a "SELECT * FROM " + table, then loop over the results and use ResultSetMetaData to get the number of columns.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this also good for finding the contents in the database?
Thanks
Jack
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic