JDBC connection between android and oracle apps

Hello.
I am new to oracle apps and android. But the coding of android is in java.
I want to create a application in which i want to connect oracle apps with my application of android written in java.
I am sending code which is not working but not having error too.
**************************** Connection class ******************************
import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class getConnection { public static Connection getDBConnection(){     Connection con;     con=null;     try{         Class.forName("oracle.jdbcdriver.OracleDriver");     } catch (ClassNotFoundException e) {         System.out.println(e);     }     try {         String url="Host String:1523:SID";         con=DriverManager.getConnection(url,"XXXX","XXXX");                 if(con!=null){             System.out.println("Connection Successfull..."+"\n");         }else{             System.out.println("Connection Failed.....");         }     } catch (SQLException e) {         System.out.println(e);     }     return(con); } }
******************************** Main CLass *************************************
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import android.os.Bundle; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.app.Activity; import android.view.View; import android.view.View.OnClickListener; public class Main extends Activity implements OnClickListener{ private EditText etUsername;     private EditText etPassword;     private Button btnLogin;     private Button btnCancel;     private TextView lblResult; /** Called when the activity is first created. */     @Override     public void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.main);                 etUsername = (EditText)findViewById(R.id.username);         etPassword = (EditText)findViewById(R.id.password);         btnLogin = (Button)findViewById(R.id.login_button);         btnCancel = (Button)findViewById(R.id.cancel_button);         lblResult = (TextView)findViewById(R.id.result);             btnLogin.setOnClickListener (new OnClickListener() {         public void onClick(View v) {         Connection con = null;                 PreparedStatement stmt = null;                 ResultSet rs = null;                 int n=0;                 lblResult.setText("Hello.");                 con=getConnection.getDBConnection();                 lblResult.setText("After Connection");                 String query = "select object_id from all_objects where object_id=18";                         try {                     stmt = con.prepareStatement(query);                 } catch (SQLException e) {                     // TODO                     System.out.println(e);                 }                 try {                     rs = stmt.executeQuery();                 } catch (SQLException e) {                     // TODO                     System.out.println(e);                 }                 try {                     while(rs.next()){                         n = rs.getInt("OBJECT_ID");                     }                 } catch (SQLException e) {                     // TODO                     System.out.println(e);                 }                                 // Check Login         String username = etUsername.getText().toString();         String password = etPassword.getText().toString();                         if(username.equals("U_Name") && password.equals("Pass") && n==18){         lblResult.setText("Login successful.");         } else {             lblResult.setText("Login failed. Username and/or password doesn't match.");             }         }         });         btnCancel.setOnClickListener(new OnClickListener() {         //@Override         public void onClick(View v) {             // Close the application             finish();         }         });     } public void onClick(View v) { // TODO Auto-generated method stub } }
I am doing this in Eclipse.
Help me out as soon as possible.
Thank You.
Edited by: EJP on 12/07/2012 16:05: added {noformat}
{noformat} tags. Please use them.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

>
I am sending code which is not working but not having error too.
>
Who do you think you are kidding? That code couldn't possibly run without errors.
The first thing you need to do is learn how to connect to an Oracle database using Java on your pc. Then you can start branching out.
Review the JDBC Developer Guide for how to connect to Oracle databases using Java.
http://docs.oracle.com/cd/B28359_01/java.111/b31224/urls.htm#BEIJFHHB

Similar Messages

  • How to make connection between ASP and Oracle 8i

    Dear Helper,
    I have a problem about how to make the connection between ASP and
    Oracle 8i. If you have this idea, please help me to solve this
    problem. Thank You!!!
    null

    You must install Oracle Objects for OLE.
    After this in asp-script you may use following instructions
    1)initialization
    <%
    Set Session("OraSession") =server.CreateObject
    ("OracleInProcServer.XOraSession")
    set Session("OraData") = Session("OraSession").OpenDatabase
    ("service", "scott/tiger",0)
    %>
    2)open Dynaset
    <%
    Set EmpDynaset = Session("OraData").CreateDynaset("select 1 as
    f1, 2 as f2 from dual", 0)
    %>
    3)navigation
    <%EmpDynaset.MoveFirst%>
    <%EmpDynaset.MoveNext%>
    <%EmpDynaset.EOF%>
    4) Field access
    <%=EmpDynaset.Fields(1).value%>
    5) Sql execute
    Session("OraData").ExecuteSQL("delete xxx")
    Best regards.
    null

  • Unable to establish connection between JDeveloper and Oracle BPA

    Hi,
    I have the jdeveloper as well as the oracle bpa installed.
    When I try to establish the connection for bpa within jdeveloper, i am unable to do so.
    I checked the connection within jdeveloper, BPA Server connection. it gives a result 'Test succeeded. After that when i click the ok button on the dialogue box, it does not close the dialogue box and allow me to proceed further.
    Any help would be appreciated
    Thanks
    krish

    Jdeveloper version is 11g and Oracle BPA Suite is 11gR1.
    Thanks

  • Problem in Connection between MapServer and Oracle Spatial

    Hi Everybody,
    First i thanks Dan Abugov for quick reply fr my previous query.
    I am working on the Oracle Spatial and MapServer
    I want to clear that MapServer is not Oracle MapViewer, this is Open Source UMN MapServer.
    When I pass the query(shown below), the empty image is displayed in the browser without any map
    http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/sdocountry/sdocountry.map&layers=country&mode=map
    I created .map file (shown below) with the Oracle Spatial Connection.
    MAP
    DEBUG ON
    STATUS ON
    SIZE 800 600
    UNITS dd
    IMAGECOLOR 255 255 255
    PROJECTION
    "proj=latlong"
    "ellps=WGS84"
    END
    EXTENT -180 -45 180 45
    LAYER
    DEBUG ON
    PROJECTION
    "proj=latlong"
    "ellps=WGS84"
    END
    NAME "CountryMap"
    TYPE POLYGON
    CONNECTIONTYPE oraclespatial
    CONNECTION "world/land@orcl"
    DATA "shape FROM country USING SRID 8307"
    CLASS
    NAME "Country_Class"
    STYLE
    COLOR 250 250 0
    OUTLINECOLOR 32 32 32
    END
    END
    END
    END
    And Set the environment variable in the apache/conf/httpd.conf file as
    SetEnv ORACLE_BASE "d:/oracle/product/10.2.0"
    SetEnv ORACLE_HOME "d:/oracle/product/10.2.0/db_1"
    SetEnv ORACLE_SID "orcl"
    SetEnv TNS_ADMIN "d:/oracle/product/10.2.0/db_1/network/admin"
    This is the my whole Sample code and configuration, I dont know why the map image is not generating.
    I am not receving any error message.
    MapServer for windows (ms4w) binaries is downloaded from "maptools.org"
    System configuration
    Windows 2000 Advanced Server
    Oracle 10g with Oracle Spatial
    MapServer 4.6.1
    Apache/2.0.55 (Win32)
    I am waiting for the some solution, from you to over come this problem.
    Thanks & Regards,
    Prema Selvam
    GISbiz.

    Prema,
    If you haven't already, you may want to post this same question to one of the MapServer mail lists (http://mapserver.gis.umn.edu/community/mailinglists/) - most MapServer users/developers are very quick to respond as well.
    -Justin

  • JDBC Connection between Unix and SQL Server 2000

    I have SQL Server 2000 installed in a pc as a data server and SQL Server 2000 JDBC Drive installed in a Unix machine. Both machines are connected and can ping each other. After setting up the environment data, I ran a test code to test the connection and got exceptions. ( I did the same process between a pc and the data server, it works well.)
    Attached are the test code and error message. Hope someone can help me.
    ******* Test Code ********
    import java.sql.*;
    * Microsoft SQL Server JDBC test program
    public class Test {
    public Test() throws Exception {
    // Get connection
    DriverManager.registerDriver(new
    com.microsoft.jdbc.sqlserver.SQLServerDriver());
    Connection connection = DriverManager.getConnection(
    "jdbc:microsoft:sqlserver://<hostname>","<username>","<password>");
    if (connection != null) {
    System.out.println();
    System.out.println("Successfully connected");
    System.out.println();
    // Meta data
    DatabaseMetaData meta = connection.getMetaData();
    System.out.println("\nDriver Information");
    System.out.println("Driver Name: "
    + meta.getDriverName());
    System.out.println("Driver Version: "
    + meta.getDriverVersion());
    System.out.println("\nDatabase Information ");
    System.out.println("Database Name: "
    + meta.getDatabaseProductName());
    System.out.println("Database Version: "+
    meta.getDatabaseProductVersion());
    } // Test
    public static void main (String args[]) throws Exception {
    Test test = new Test();
    ******* error message ********
    Exception in thread "main" java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
    at java.lang.Throwable.fillInStackTrace(Native Method)
    at java.lang.Throwable.fillInStackTrace(Compiled Code)
    at java.lang.Throwable.<init>(Compiled Code)
    at java.lang.Exception.<init>(Compiled Code)
    at java.sql.SQLException.<init>(SQLException.java:64)
    at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
    at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
    at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
    at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
    at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
    at java.sql.DriverManager.getConnection(Compiled Code)
    at java.sql.DriverManager.getConnection(DriverManager.java:137)
    at Test.<init>(Test.java:10)
    at Test.main(Test.java:32)
    ************ end of message ***********

    If it works from a PC and not from the Unix box then you may have a network issue of some sort, I.E. firewall not letting it through etc.
    Try using telnet on the Unix box to see if you can connect to the sql server on the port that the SQL server is listening.
    E.G.
    telnet server_name 1433
    You may need to change the port number to the one that the SQL server is using.
    Col

  • How to establish an Oracle connection between server1 and server2

    I am trying to establish an Oracle connection between server1 and server2 specifically, while logged into server2 launch OEM on server1. Can anyone help me out here on establishing this connections between the 2 servers. thank you inadvance

    I am assuming this is 10g.
    Same way you connect from your desktop to the server using the URL (e.g http://server1:1158/em).
    But you have to ensure that server2 can see server1. They cannot see each other, then it is not OEM problem.
    if it is not 10g, then let me know

  • Handoff: No connection between iPad and iPhone

    Handoff: No connection between iPad and iPhone (IOS 8).

    Hi raydela,
    I understand your calls aren't being transferred between devices.
    Check out the troubleshooting in this article.
    Get help using Continuity with iOS 8
    If a call doesn't transfer to your other devices, or you don't see the Handoff icons
    Make sure that your devices are using iOS 8 or later by going to Settings > General > Software Update.
    Check your settings:
    Go to Settings > Wi-Fi and turn on Wi-Fi if necessary.
    Go to Settings > Bluetooth and turn on Bluetooth if necessary.
    Make sure your iOS devices are connected to the same Wi-Fi network by going to Settings > Wi-Fi and comparing the name of the network each is on.
    Go to Settings > General > Handoff & Suggested Apps and turn on Handoff.
    Go to Settings > Phone and turn off Wi-Fi Calling.
    Best Regards,
    Nubz

  • No connection between iPhone and computer

    I have No connection between iPhone and computer. Please help me. My iPhone (4s) went nuts a little while ago. Nothing happend when I connected the charger. I had to take out and put it back in again and again and again, between 2-10 times before the charger finally was connected. It's been like this for a while now and a did'nt really have that mutch problem with it. Until today when I tried to sync/backup/restore the whole phone. It started to sync but stoped at the sync of the 5:th app. tried to start over but now my computer can't "find" the phone. It says that the USB-device is not reconizeble.
    Please help me.
    Sorry for the bad english.

    See Here...
    Device Not Recognised
    http://support.apple.com/kb/TS1538
    And Here
    iPhone, iPad, or iPod touch not appearing in iTunes
    iPod appears in Windows but not in iTunes
    Also, Here...
    Unable to Update or Restore
    http://support.apple.com/kb/HT1808

  • Can We use FDM as ETL tool between SQL and Oracle

    I want to use FDM as ETL tool between SQL and Oracle. Can it be possible. I didn,t found any target adapter for oracle database.My source system is SQL and Target system is Oracle database.
    Rahul
    Edited by: user12190125 on Nov 9, 2009 4:23 AM

    Rahul,
    I believe this is possible to do, but not an easy one and there are a few considerations:
    How much data are you processing? FDM has a lot of features which support the business process. While this is great for users and audit trail etc. it slows down performance if you want to process a lot of data. It also depends on the type of mappings you use (Like mappings are slower than explicit mappings).
    How familiar are you with VBScript? There is no explicit target adapter for Oracle, but there is a data mart adapter which can be used for anything. You have to implement everything yourself though, mainly the Export and Load actions. In there you will also have to handle the the connections to the MSSQL and Oracle databases.
    Check the data mart adapter and see if you feel comfortable with defining the vb code in there. There are reasons for and against this approach. ODI would probably be the better choice unless you really need to have FDM's process support.
    Regards,
    Matt

  • Steps too create connection between OBIEE and Datamart on UNIX box..

    Hi experts..
    I have created one repository on my windows machine. Now i need to transfer this repositry on UNIX BOX.. So
    1. Please tell me the steps to make a connection between OBIEE and datamart.
    2. which files i need to transfer from windows machine to UNIX Box..

    Are you asking how to connect to an Oracle database from OBIEE in Unix? (Your question is too vague as datamart could mean anything) If so, read this thread:
    Re: How to connect Linux OBIEE repository to database?

  • Need to establish Connection between CRM  and   Virtual Directories.

    Dear All,
    I am working for Telecom project.
    I have one requirement that we need to establish Connection between CRM and   Virtual Directories.
    This is existing in Access management system.( SAP EP environment )
    The basic requirement is, with  SAP EP environment we are integrating 8 different application. But for all this Application we have a one more system called Access management system (like Basis in Sap). This will validate the user access and BP(Business Partner ) data for users who logon to a different respective application. For all this applications Company data (Master Data) has to provide from CRM and the changes took place for Company data in CRM will be updated in to Virtual Directories .For this service we need to establish Delta mode connection between SAP CRM and Virtual Directories.
    Which is existing in Access management system .
       Do we have any standard connectors from SAP CRM to connect and who we can achieve this .
    Please let us know..Certainly there will be a reward points
    Thanks & regards.
    BNP

    Try posting this question on the BPA Suite forum - http://forums.oracle.com/forums/category.jspa?categoryID=194

  • Difference btwn Oracle Ebusiness Suite and Oracle Apps SCM

    Whatz the diffrence between training in Oracle apps E business suite and Oracle Apps SCM?

    E Business suite includes Oracle Apps SCM along with HR, Finance, Projects and Sales and Marketing family packs

  • Connection Between JSP and PostgreSQL

    Hello all,
    Pls provide me some code about database connection between JSP and PostgreSQL.
    i need reference of PostgreSQL and JSP also.
    Thanking u,
    Ripon

    go to PostgreSQL website and download the JDBC or other connection and use it.
    Setup the connection from your controlpanel > ODBC data source if its win98 OS.

  • Connection between O and BP is missing

    Hi,
      When i check inconsistency for a user, i am getting " Connection between "O" and "BP" is missing. When i check the Org.unit in PPOSA_BBP, i could see no BP exists for that Org.unit where user is assigned. I have replicated the org.unit from HR system but yet the BP hasnt been generated. Can you please share your idea on this.
    Regards,
    Prasath J

    Hi Prasath,
    This might be because you need to assign the user to a Purchasing Organisation or a Purchasing Group. If the user do not have BP created then you can do this by using tcode USERS_GEN.
    Go to USERS_GEN and follow below steps :
    1. Select Create User From Existing SU01 user
    2. Enter the org id of the POrg or Pgroup under which you want to assign the user
    3. Select country and execute
    4. In next window one popup will occur, select Area Of User
    5. In next popup enter the user id
    6. Next select the user and click Ok.
    7. This will create a BP and CP for the user and assigns the BP to the Org id of the POrg or Pgroup.
    8. Now check the consistency of the user it will show all green.
    It might give you error like eMail id for BP XXXXX is missing if the SU01 profile of the user does not contain any user id but it is not critical.
    You can open the BP in BP tcode and enter the email id of the user.
    Let us know if it solves your issue.
    Regards,
    Mayur

  • Can someone please tell me a simple but effective method for burning a slideshow to DVD? Now that the connection between iPhoto and iDVD no longer exists, I can't figure out a way to get there with an acceptable quality result.

    Can someone please tell me a simple but effective method for burning a slideshow to DVD? Now that the connection between iPhoto and iDVD no longer exists, I can't figure out a way to get there with an acceptable quality result.

    Export the slideshow out of iPhoto as a QT movie file via the Export button in the lower toolbar.  Select Size = Medium or Large.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    If iDVD was not preinstalled on your Mac you'll have to obtain it by purchasing a copy of the iLife 09 disk from a 3rd party retailier like Amazon.com: ilife 09: Software or eBay.com.  Why, because iDVD (and iWeb) was discontinued by Apple over a year ago. 
    Why iLife 09 instead of 11?
    If you have to purchase an iLife disc in order to obtain the iDVD application remember that the iLife 11 disc only provides  themes from iDVD 5-7.  The Software Update no longer installs the earlier themes when starting from the iLIfe 11 disk nor do any of the iDVD 7 updaters available from the Apple Downloads website contain them. 
    Currently the only sure fire way to get all themes is to start with the iLife 09 disc:
    This shows the iDVD contents in the iLife 09 disc via Pacifist:
    You then can upgrade from iDVD 7.0.3 to iDVD 7.1.2 via the updaters at the Apple Downloads webpage.
    OT

Maybe you are looking for

  • Battery or not battery, that is the question!

    Ok, I'm a bit confuse, I read many post on Apple Support Forum, IpodLounge forum and some other stuff found on Google. Don't worry, I did my homework and now I'm out of solution to ID my iPod problem. Model: iPod Mini 4G 1st generation. Basicly, it r

  • Itunes window does not open

    running itunes 8 on 2.4ghz osx 10.5.5 imac. when i open itunes the application opens but the window does not nor can i get it to open. when i initially click on itunes to open it the curser blips to the opening egg timer for about 1 quarter second bu

  • [SOLVED] VLC does not play any (almost) video

    After recent upgrade vlc (to 1.1) stopped playing any video only audio. Error message looks like No suitable decoder module: VLC does not support the audio or video format "$name_of_codec". Unfortunately there is no way for you to fix this. At the ve

  • How can you transfer from Pages to epson iprint document folder for printing

    I have my epson printer recognized by the app. but cannot work out how to get my documents into the epson iprint app. Thatnis how doesnone transfer documents form Pages to the documents section of the iprint app. Also can you place more than 1 photo

  • Reset button in Prompts in 11g

    Hi friends Please explain the function of Reset button in prompt ?