将codename one连接到php/mysql
我在构建代号为one的移动应用程序时遇到以下错误 代码在无代码名项目中工作将codename one连接到php/mysql,php,xml-parsing,java-me,codenameone,Php,Xml Parsing,Java Me,Codenameone,我在构建代号为one的移动应用程序时遇到以下错误 代码在无代码名项目中工作 public Actualite[] select(){ try { ActualiteHandler matchHandler = new ActualiteHandler(); // get a parser object SAXParser SAXparser = SAXParserFactory.newInstance().ne
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
Codename One既不支持
SAXParser
也不支持java.io.File
我还看到您使用了Connector
,它是一个J2ME类,不受支持
您需要使用和文件系统存储
请参阅此处的开发人员指南。Codename One既不支持
SAXParser
也不支持java.io.File
我还看到您使用了Connector
,它是一个J2ME类,不受支持
您需要使用和文件系统存储
请参阅此处的开发人员指南。要添加此内容,有一篇新文章介绍后端与mysql的连接:要添加此内容,有一篇新文章介绍后端与mysql的连接: