I have deployed my servlet code on cloud which access the database cloud , but when i try to access the URL of deployed application , it asks for my credentials (username and password)....
Now that i want to embedd my servlet link on cloud to my android app code , how to escape the credentials , or is their any way so that i can add my username and password in my servlet code itself. This is my servlet code and it is working fine..
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
// out.print("system");
try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("javatrial5196db");
// out.print(ds.toString());
conn = ds.getConnection();
stmt = conn.createStatement();
rs = stmt.executeQuery("select * from test");
while (rs.next()) {
out.println(rs.getString("id") + " " + rs.getString("password") + "<br>");
}
conn.close();
stmt.close();
} catch (Exception e) {
out.print(e);
}