11-04-2010, 05:38 AM
|
#1 (permalink)
|
| New Member
Join Date: Nov 2010 Model: 7600 PIN: N/A Carrier: StarHub
Posts: 1
Post Thanks: 0 Thanked 0 Times in 0 Posts
| How can i use httpConnection with MDS in blackberry device Please Login to Remove! What was wrong with my coding?
public Employee[] readDataFromExcel()
{
HttpConnection conn=null;
String[] nameList=null;
InputStream is=null;
try {
conn = (HttpConnection )Connector.open(fileName+";deviceside=false", Connector.READ_WRITE,false);
is = conn.openInputStream();
employee=rawData(getData(is));
} catch (Exception ex1) {
try {
conn = (HttpConnection )Connector.open(fileName+";deviceside=false", Connector.READ_WRITE,true);
is = conn.openInputStream();
employee=rawData(getData(is));
} catch (Exception ex2) {
try {
conn = (HttpConnection )Connector.open(fileName+";deviceside=true", Connector.READ_WRITE,true);
is = conn.openInputStream();
employee=rawData(getData(is));
} catch (Exception ex3) {
try {
conn = (HttpConnection )Connector.open(fileName+";interface=wifi", Connector.READ_WRITE,true);
is = conn.openInputStream();
employee=rawData(getData(is));
} catch (Exception ex4) {
is= getClass().getResourceAsStream(FileName1);
employee=rawData(getData(is));
}
}
}
} finally {
try {
if (conn != null) {
conn.close();
}
if (is != null) {
is.close();
}
} catch (Exception e) {
}
}
return employee;
} |
| Offline
| |