1
我在构建代码名为1的移动应用程序时遇到以下错误。将代码名称1连接到php/mysql
的代码是没有代号项目
public Actualite[] select(){
try {
ActualiteHandler matchHandler = new ActualiteHandler();
// get a parser object
SAXParser SAXparser = SAXParserFactory.newInstance().newSAXParser();
// get an InputStream from somewhere (could be HttpConnection, for example)
HttpConnection hc = (HttpConnection) Connector.open("http://localhost/abbes/select.php");//people.xml est un exemple
DataInputStream dis = new DataInputStream(hc.openDataInputStream());
dis.toString();
SAXparser.parse(dis, matchHandler);
// display the result
matches = matchHandler.getMatch();
return matches;
} catch (ParserConfigurationException ex) {
ex.printStackTrace();
} catch (SAXException ex) {
ex.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}
return null;
}
在这里工作是错误
error: cannot access File
SAXparser.parse(dis, matchHandler);
class file for java.io.File not found
只是为了增加这个功能,这个新帖子涵盖了后端与mysql的连接:https://www.codenameone.com/blog/connecting-to-a-mysql-database.html –