MySQL Forums
Forum List  »  Newbie

Re: how can i open sql database
Posted by: Roland Bouman
Date: July 15, 2005 04:34AM

Can't you specify the name of the database in the url you use to make the connection? Please send the line u use to connect

Anyway, when you do have an active connection you should be able to create a statement object using a query like

String qry = "use " + dbname;
Statement stmt = conn.createStatment(qry);
stmt.execute();

To check if there's already a database active, use query like this:

"SELECT DATABASE()"

Options: ReplyQuote


Subject
Written By
Posted
July 14, 2005 05:51AM
Re: how can i open sql database
July 15, 2005 04:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.