How to embed URL of deployed java servlet into Android code

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);

What is the intended behavior here, how will the user be authenticated if credentials are not obtained from the user ? By default the JCS applications will be secured and the system will prompt for login, you can disable the login by adding "<login-config/>". You can also configure the authentication to use BASIC / FORM authentication instead. Hard coding credentials to servlet / DB table does not sound like a good solution to me though.. For details on security refer to this document.
Jani Rautiainen
Fusion Applications Developer Relations
https://blogs.oracle.com/fadevrel/

Similar Messages

  • How to embed URL (Longer than 60 Chars) into CRM-Web UI

    Hello
    i would like to have a textfield with an URL embeded into the Incident UI
    So far i managed to create the Char-Field and fill it with the URL
    Unfortunately the generated Fields are limited to 60 Chars, but i need 100 for the URL with all parameters to work.
    At the Moment the URL is truncated to 60 chars which leaves the link unfunctional
    Any Ideas would be appreciated.
    Kind regards
    Rolf

    Hi Rolf,
    I build a simple URL shortener in our system similar to ABAP URL shortener
    The concept is quite easy. You store the source URL in a table and use a unique short-id instead. In my case I use function GENERAL_GET_RANDOM_PWD to generate the id for a given length (e.g. aBcD3). In addition, I created an ICF node 'ID' with a handler class that passes the short URL (e.g. http://mycompany/id/aBcD3) to the corresponding long URL, which can be internal or external.
    The other option is to split the URL path into string_table and store the last entry, like:
    lv_path = server->request->get_header_field( '~path_translated' ).
      IF NOT lv_path IS INITIAL.
        SPLIT lv_path AT '=' INTO TABLE lt_path.
        DESCRIBE TABLE lt_path LINES lv_lines.
        READ TABLE lt_path INTO ls_path INDEX lv_lines.
        lv_guid = ls_path.
      ENDIF.
    Regards, Richard

  • How to create dynamic images in java servlets?

    I want to create dynamic images in java servlet. Can servlet create dynamic images that based on the input data files? The results can be displayed in GIF, JPG..format? how can this be done? any example in internet?
    What OS do I need to install and what other requirements needed if i want to build up a servlet server?
    Thanks a lot!

    Also worth having a look at SVG http://www.w3.org/TR/2001/REC-SVG-20010904/, you can get a viewer at http://www.adobe.com/svg/ or you can use Batik http://xml.apache.org/batik/index.html to convert SVG to other formats such as JPEG.
    HH

  • How to Call SQL Loader from Java ( servlet )?

    We need to call SQL Loader command from Java Servlets? Any suggestions how this can be done?
    Thanks
    Rahul

    Probably not the best way, but you could try using JNI to call a C function which then invokes SQL Loader via system() or exec(). I haven't done this myself though...

  • How can i use twain from java servlet?

    dear all
    iam a web developer ,iam haviving now a task to search in point pf scanning image through web (Intranet) using java
    can any one tell where can i find resources how to deal with Twain using java (On web specially not from a desktop application)
    i hope u can help me
    Thanks in advance
    Yours,
    Amr
    Senior Java Web developer

    Hi,
    You can try a package named: JTwain, which is available at http://asprise.com/product/jtwain.
    JTwain supports all kinds of digital cameras and scanners. You can use Java to access, contorl digital cameras and scanners, and of course, to acquire images with flexible settings.
    The developers' guide is available @ http://asprise.com/product/jtwain/devGuide.php
    In the simplest case, one line of Java code can solve your problem.
    Good luck!

  • How to embed a file(of any type) into excel sheet

    I am creating a excel file through java and its available to browser to download and save as its created at server side.I wnat to embed a file of any type into this excel file like we do thru menu Insert->object , so that when i click on this object i must be able to see/open the file.
    am using jxl package for creating excel file thru wtitablesheet interface.
    Thanks In Advance....

    Dear Terry,
                 Thanks for your kindly remind, Maybe I made a mistake for not clearly claim the request. Like you mentioned, This is an issue for WDA4, I should ask  ABAP exports for help.
                 Anyway, Thanks for you both reply.
    Best Regards
    Richard

  • How to check who has deployed a PAR into the portal

    Hi there,
    is there any log from which can be checked who has deployed a PAR into the portal (probably using NWDS directly)?!
    Thanks in advance
    Praveen

    Hello Praveen,
    You can find the user info from the trace files which are located in usr/sap/SID/DVEBMGS<SysNo.>/j2ee/cluster/server0/log/ subfolders.
    Try to extract the info from the Tracefiles.
    Again if you have the Logviewer configured then you might be able to find the same info there too.
    Regards,
    Premkishan

  • Retrieving Java.vendor into Javascript code

    Hi, I need to check whether the user has the "Use Java 2 version<??> <applet>" (i.e. is using Sun, rather than Microsoft) checked in advanced options under 'internet options' in IE6.
    I tried to do this by using the code examples in this thread to pull back the java.vendor value (see below for html and applet)
    However, even if the check box is not ticked, I recieve the Java.vendor value "Sun Microsystems"
    However, when I run the following example applet (written by someone else who has managed to pull back system info), I get back the the Java.vendor value of "Microsoft" correctly, when the above box is unchecked, and the value of "Sun Microsystems" when the value is checked. <http://www.codeconduct.com/java/SysInfoDemo/SysViewerDemo.htm>
    I also noticed that when I ran my script, the Java symbol pops up in the system tray.
    Why the discrepancy? and how can I alter my code to send back the correct java.vendor to my Javascript code.
    Thanks for your help
    Roger
    //////////////DETECTPLUGIN.HTML///////////////////////////////
    <HTML>
    <HEAD>
    <TITLE>Detect Java Runtime</TITLE>
    </HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    var browsername;
    function getJava()
    var applet = document.myApplet;
    if(applet == null)
    document.writeln("Java Runtime Environment not installed");
    document.writeln("JRE Version: " + document.myApplet.getJavaVersion());
    </SCRIPT>
    <body onLoad="getJava()">
    <OBJECT id="myApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    WIDTH = 1
    HEIGHT = 1 >
    <PARAM NAME = CODE VALUE = "DetectPluginApplet.class" >
    <PARAM NAME="scriptable" VALUE="true" >
    <embed type="application/x-java-applet;version=1.3"
    code = DetectPluginApplet width = 2 height = 2 MAYSCRIPT = "true" >
    </embed>
    </EMBED>
    </object>
    </BODY>
    </HTML>
    //////////////////DetectPluginApplet.java/////////////////
    import java.awt.*;
    public class DetectPluginApplet extends java.applet.Applet
    public void init()
    add(new Label("DetectPluginApplet"));
    public String getJavaVersion()
    return System.getProperty("java.vendor");
    }

    I should add that I have Sun's Java 2 Runtime Environment 1.4.0_02 installed on my machine. Also, the checbox in 'advanced options' is under "Java(Sun)"

  • How to embed feeds in to a servlet/webpage

    i am working on a stock market simulation. i am planning to have the feeds of the latest stock prices(live) and other info regarding the market on my web page for the users. how do i embed the feeds into the servlet . i am using servlets and html for developing the web page.
    any idea?
    thnx in advance

    You have to read the homepage or text file those are available online and updated periodically.
    The following are the tutorials from sun on reading URL with Java(Someone in this forum has posted before).
    http://java.sun.com/docs/books/tutorial/networking/urls/index.html

  • How to run and compile a java servlet on Tomcat?

    Hi, I am very new to servlets in Tomact.
    I went to the java tutorial and from the address below I copy an example (SimpleServlet).I try to run and compile it in Tomcat, But I don't know how can I do that. I appreciate if somebody tell me the command line for compiling and running this example and the necassary steps. (My Tomcat is installed perfactly).
    http://java.sun.com/docs/books/tutorial/servlets/overview/simple.html
    Thankx

    Hello,
    I have the similar question.
    Instead of going thru sun's tutorial, I tried onjava's ("http://www.onjava.com/pub/a/onjava/2001/04/19/tomcat.html?page=1").
    I could see the jsp page, but when I tried to add a servlet, I got an error "Page not found". I followed exactly the same way they describe. The only thing I noticed was the resulting page on the tutorial had the URL of ".../servlet/...".
    Is this "servlet" directory something we are supposed to create our own? If so, under what directory? Or do we need to set up anything in order for the servlet to be referenced that way?
    Thanks in advance.

  • How to compile and run a Java servlet using the BEA weblogic server

              Hi,
              Could you help me out as to how to compile a servlet using Web Logic server.I have written a Servlet program and have also set up the environment in the "c:\bea\wlserver6.0\config\examples" folder by giving the command setExamplesEnv.cmd.
              I have stored my GreetingServlet.java file in "c:\bea\wlserver6.0\samples\examples\servlets" folder.
              How do I compile my servlet now?
              Vid
              

    Hello,
    1. The .form file was used by Netbean's GUI builder to create the .java and is not needed for compilation.
    2..../src # javac -classpath "..." mytool/*.java
    I guess the package mytool was not coped with.
    Alternatively it is worth to use the ant build tool also used by Netbeans.
    Then you can make a jar from the class files, indicate in the manifest.mf file:
    1. the main class
    2. the library jars

  • Deploying Java Servlets

    After developing applications in JDeveloper, I would like to
    deploy them into the portal. What is the best way to do it?
    Thanks

    Well, I at least figured out how to start Tomcat. Here is the article which tells you how to enable it in Server Admin 10.5:
    http://docs.info.apple.com/article.html?path=ServerAdmin/10.5/en/c2ws4.html
    The problem I'm having now is how to access my jervlets and apps. All the tomcat documentation is for running stuff on localhost:8080 but I don't want to run it there. I want to run it on my Mac Server 10.5. Just using http://mymacserver.net/mywebbapp/page.html doesn't seem to work. I've put my files in the Library/Tomcat/webapps directory (as per the documentation) but it can't find them.
    The help files say that you can verify Tomcat is running by entering the URL for your site followed by :9006 but that isn't working. I've started and stopped the web container so Tomcat should be running but I can't even get the default page to show up.

  • How to embed URL in illustrator

    Hi all, I have an illustrator document that shows a road map, I have a button on that map that takes you to google maps. Im putting the URL on the button using the Attributes palette in illustrator, but when I export a pdf, the button isnt working, so I end up having to do the button link in acrobat.
    How do I make the URL (button) work from illustrator to a pdf?
    Cheers
    Lee

    That would explain it .... InDesign here I come.
    Thanks
    Lee

  • How to connect microsoft sql with java servlets

    what are steps i should do after writing servlet program to connect with microsoft sql. what coding should i add in web.xml file.if any other steps mention it. i didn't get output or err msg in browser.if i should install jdbc drivers seperately for sql mention it.

    Hi,
    Try to find a DataBase driver for MS SQL ( type 4 which is a pure java) first and put it on the class path i.e under ../lib
    Then in your sevlet, load the DriverManager and from it get a connection to the database as per JDBC spec.
    Regards.
    Alan Mehio
    LONDON, UK

  • How to translate this statement to java servlet code

    INSERT INTO table_name (column1, column2,...)
    VALUES (value1, value2,....)

    You wouldn't translate that statement to servlet code. The idea doesn't make any sense. However you might include it in a servlet; read the tutorial that zadok linked to.

Maybe you are looking for

  • Flash on international laptop

    Will there be any issue with Flash running off a laptop form a different country it was developed on?  We just want to be able to open the html page and have everything running locally off the laptop. The application was made in USA and the laptops i

  • How to save the current Indesign defaults file?

    Hi, I've tried following the Indesign Classroom in a book but I find it left a lot to be desired for anyone new to this e.g ME!!!!. So can someone please tell me how I can save the current InDesign defaults file on a windows and if you can please do

  • RKEVEXT3 - Execute CO-PA External Data Transfer - Report

    Hi All, We are using the report RKEVEXT3 to post the T&I data to the SAP. We have the input file and this program gets triggered and the job runs for around 3 hours. This long time is causing the problem for our overall job schedules.. What we though

  • Is there a best way to create a uuid.

    Hi all, I'm a little bit confused about the right way to create unique objects ids, a way not depend on a database. There seems to be several approaches to do this: 1.The class java.rmi.dcg.VMID states: 'A VMID is a identifier that is unique across a

  • Problem to install modul SCXI 1112 with a 1000DC chassis

    I want to install the module SCXi 1112 with the chassis 1000DC but when I test the chassis with NI Max, it don t find the module.I connect the chassis to a MIO 6025E. One precision, I have control the connection between the two elements and the autod