Changeset 14045 for trunk/FACT++/src/smartfact.cc
- Timestamp:
- 06/02/12 21:24:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/smartfact.cc
r14043 r14045 7 7 8 8 #ifdef HAVE_SQL 9 #include <mysql++/mysql++.h>9 #include "Database.h" 10 10 #endif 11 11 … … 1739 1739 try 1740 1740 { 1741 static const boost::regex expr("(([[:word:].-]+)(:(.+))?@)?([[:word:].-]+)(:([[:digit:]]+))?(/([[:word:].-]+))");1742 1743 boost::smatch what;1744 if (!boost::regex_match(fDatabase, what, expr, boost::match_extra))1745 throw runtime_error("Couldn't parse '"+fDatabase+"'.");1746 1747 if (what.size()!=10)1748 throw runtime_error("Error parsing '"+fDatabase+"'.");1749 1750 const string user = what[2];1751 const string passwd = what[4];1752 const string server = what[5];1753 const string db = what[9];1754 const int port = atoi(string(what[7]).c_str());1755 1756 mysqlpp::Connection conn(db.c_str(), server.c_str(), user.c_str(), passwd.c_str(), port);1757 1758 1741 const mysqlpp::StoreQueryResult res = 1759 conn.query("SELECT fSourceName, fRightAscension, fDeclination FROM source").store();1742 Database(fDatabase).query("SELECT fSourceName, fRightAscension, fDeclination FROM source").store(); 1760 1743 1761 1744 out << HTML::kWhite << '\t';
Note:
See TracChangeset
for help on using the changeset viewer.