mysql - how the command 'use database-name' is using java code -


i make o program store data excel files in databases. have plenty of databases in program have choose in 1 store data. have made code able connect mysql program , show available databases. in database store data. more specific user first of see tha available databases in client , afterwards have chance in database data stored. me how this?

the code see available databases below:

class.forname("com.mysql.jdbc.driver");         connection con = (connection) drivermanager.getconnection(                 "jdbc:mysql://localhost:3306/", "root", "root");         databasemetadata meta = (databasemetadata) con.getmetadata();         resultset res = meta.getcatalogs();         system.out.println("list of databases: ");         while (res.next()){             system.out.println (" " +res.getstring(1));     } 

thank in advance!

i hope this link should . can data connection object


Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -