How to connect with Oracle database in JSF ?

Hi ,
am very new to JSF,i want to perform a database connection with an Oracle database through JSf.Is there any special tag as such in struts for DB connectivity in JSF?Can any one help me?

No.
A database shouldn't even be reached from inside the view layer. Do it in the controller/business layer, e.g. the backing bean. Read on about JDBC, DAO, DTO. If you're already familiar with that, consider an ORM, like Hibernate.

Similar Messages

  • How to connect to  Oracle database from webdynprojava application

    Hi
    How to connect to  Oracle database from webdynprojava application. where can we provide the code to connect to database.?
    Thank You.

    Hi,
    You need to create  Java Bean model. The bean is a typical java bean with default constructor, getter and setter. You can have additional methods for query etc. The attributes in the class will be your model node and attributes.
    However you need to configure the connection and create JNDI using visual administrator before writing the code.
    You can also consider writing Session EJB with oracle and using them in WD.
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/dcaa4f05535591e10000000a1553f7/frameset.htm
    Srini

  • How to connect to oracle database from visual basic 2010 express edition

    I have installed visual basic 2010 express edition on windows xp. But visual basic 2010 express edition supports Microsoft sql server database file,Microsoft sql server compact 3.5, Microsoft access database file. I want to connect to oracle database from visual basic 2010 express edition. So what drivers are required and how to do connectivity?

    Hello,
    I wasn't clear on what you were using to make the connection. I had a look in Visual Studio 2010 (don't have express to test sorry).
    I think you mean the Data Sources available under the menu Data-> Datasources. this seems to match the description you give when I
    look at the list of datasource options.
    In here you can make ODBC connections via the Microsoft .net Data Provider .
    If you select ODBC as a datasource you can see listed the DSN's you created - for example I see 2 which use the Oracle ODBC driver.
    This assumes you installed an Oracle Client + the oracle version of the ODBC driver (comes with the oracle client).
    Once you created a server connection then you should see it in the server explorer.
    You can also download the Oracle Developer Tools for Visual Studio which is an add on for VS.
    ** I suspect this is only for VS 2010 and I didn't see that Express was supported.
    http://www.oracle.com/technetwork/developer-tools/visual-studio/overview/index-097110.html
    Let me know if that helps.
    John

  • Cannot establish connection with Oracle database

    Hello
    This is the first time I use BOE server with Crystal Report to execute some tests, and one issue is blocking me now, and I am not even sure if this is the right Forum where I should post it.
    I installed BOE server XI 3.1 SP4 on Linux machine (new installation), and then I uploaded some existing Crystal Report templates that are working fine on another BOE server. Those CR templates have to establish a connection with a remote Oracle database to get the data, and we pass all credentials for this purpose.
    The first time I run my first test I received this error that I could not find anywhere on the web :
    ErrorLog 2011  8 10  7:05:52.505 14215 356 (Administrator:82) (../reporthandler.cpp:12462): CReportHandler::buildReportViewerError: CSResultExceFailed to open the connection." FileName:"../reporthandler.cpp" LineNum:12458 ErrorCode:756 ErrorMsg:"Failed to open the connection.
    {FBAD55EE-BEAF-11E0-BC1C-005056813A72}.rpt" DetailedErrorMsg:""
    I believe that the CR was not able to establish the connection with Oracle, so I install Oracle Client on the same machine (test remote connection ==> pass), I set the ORACLE_HOME variable, and I edit the file <installation_home>/ bobje/java/CRConfig.xml to add the path to ojdbc14.jar, and finnaly restart the tomcat server. However I am still getting the same error message.
    Is there any hint that can help me troubleshooting this issue?
    Thank you

    do the reports use native oracle connectivity or JDBC ?
    what version of Oracle client did you install ?
    was it 32bit or 64bit client ?
    what your LD_LIBRARY_PATH variable set to ?
    what does it say in the CMC when you look at CR report's DB properties ?

  • How to connect with Oracle in java

    Hello!
    I would like to use java for my graduation project. And connect with Oracle in java.
    I used j2sdk1.4.2_04 and Oracle 9i release 9.2.0.1.0
    May I ask where could supply me information or content ?
    Thanks!!

    hi jus a sample code
    public class DbUtil {
    // Connection instance
    private static Connection conn = null;
    private Object connection;
    public DbUtil() {
         // Connect to the database
    dbConnect();
    * This method performs the clean up action and closes the application
    void exitDbUtil(){
    // If connected to database
    if (conn != null) {
    try {
    // Close the connection
    conn.close();
    conn=null;
    catch (Exception ex){      // Trap errors
    System.out.println(" Error while Closing the connection: "+ex.toString());
    * Creates a database connection object
    private void dbConnect() {
    try {
    String driverName = "oracle.jdbc.driver.OracleDriver";
    Class.forName(driverName);
    String url = "jdbc:oracle:thin:@" + ConnectionParams.s_hostName +
              ":" + ConnectionParams.s_portNumber +
              ":" + ConnectionParams.s_databaseSID;
    // Create a connection object
    conn = DriverManager.getConnection(url, ConnectionParams.s_userName,
                             ConnectionParams.s_password);
    catch(Exception e){

  • Connectivity with  oracle database using web Dynpro(for java)

    Hi,
    In web Dynpro we will connect to SAP systems by using Adaptive RFC.  Then How to connect the oracle 8i/9i using webdynpro? Plese tell me the procedure to establish the connecting using enterprise portal?
    Thanks & Regards,
    Mastanvali Shaik

    Hi,
    Check these:
    WebDynpro and Oracle using DTOs
    https://wiki.sdn.sap.com/wiki/display/VC/JDBCConnectionSetup
    Connecting Problum of SQL
    Greetings,
    Praveen Gudapati
    [Points are welcome for helpful answers]

  • Problems with connection with Oracle Database (Dreamweaver)

    I'm trying to create a connection with a oracle database, with JDBC.
    In order to do that, I've downloaded the classes12.zip driver in my machine. This is the driver from Oracle.
    I've put this file into directory c:\Program Files\Macromedia\Dreamweaver MX\Configuration\JDBCDrivers.
    So, I've gone to Window -> Application -> Databases menu into Dreamweaver MX, clicked in the plus (+) signal and choosed Oracle thin Driver (Oracle).
    I've filled thin window with the following values:
    Connection name: conn1
    Driver: oracle.jdbc.driver.OracleDriver
    URL: jdbc:oracle:thin:@machinename:1521:SID
    Username: ....
    Password: ...
    When I click in the Test button into this window, the following success message appears:
    Connection was made successfully!
    But when I go to Bindings window to build a Recordset, the connection doesn't get the tables, and the following error message appears:
    Unable to retrieve tables from this connection, click on 'Define...' button to test this connection.
    Does somebody know the answer for this problem?
    Thank you.

    Don't bother with a loopback adapter unless you are using a laptop that needs Oracle to work whether connected or unconnected to the business network. Much simpler to just arrange for DHCP to assign you a fixed IP address (a lease reservation).
    It's the change of IP address which trips Oracle up, not the existence of DHCP. So if you can make sure your IP address will be the same, no matter how you acquire it, that's all you have to do.
    Installing a loopback adapter which isn't the primary interface at the point you install Oracle will mean your installation will get very confused as to whether to address things via the 127... address or the "normal" IP address. And yes, at that point, you'll not be able to connect to instances, or run listeners or do all sorts of other things reliably.
    If it were me, I'd uninstall the mess you probably now have as far as Oracle goes, install something like VirtualBox (free) or VMware Workstation (costs) and enjoy your Oracle experience inside the confines of a virtual machine whose networking setup you can configure and control to your heart's content, without it screwing up your real machine's ability to connect to your work's network when it needs to.

  • How to connect to Oracle Database table using xquery (using 'ora:view')

    Hi,
    I am new to this forum and JDeveloper, but I am trying to use xquery accessing an Oracle database, but I can't seem to get it working, nor can I find what I am doing wrong.
    The xquery statement I (try to) use is:
    for $x in ora:view("TOU_TEST")
    return $x/txt
    (In which "TOU_TEST" is the table with column 'txt')
    But I get this "Dutch" error message:
    Er moet een JDBC-standaardverbinding beschikbaar zijn voor de functie 'ora:view'.
    (basically giving an error message about the default JDBC connection).
    I've searched a lot (Technet, Google, JDeveloper Help), but can't find out what I am doing wrong.
    Could you tell me what I am doing wrong/ how to solve this?
    Thanks a lot.
    Greetings,
    Tom

    Hi Friend,
    Try this.
    "Declaration.
    data : begin of zemployee.
               Include structure zeployee542.
    data : end of zemployee.
    *in screen give field name as <zemployee-Fieldname>
    case 'OK_CODE'.
    WHEN 'SAVE'.
          perform fill_data.
    ENDCASE.
    form FILL_DATA .
    move-corresponding zemployee  to  zeployee542.
    insert zeployee542.
    clear : zemployee, zeployee542.
    endform. " FILL_DATA
    Reward if you find usefull

  • Is it possible create a new connection with oracle database in javascript or formcalc?

    I need create a new connection, but it is necessary that I connect when the user click in a button.
    Is it possible?
    How can I do?
    Thanks
    Rubén

    How to connect ORACLE database to ADOBE LIFE CYCLE READER EXTENSION or ADOBE LIFE CYCLE DESIGNER

  • Help for getting connection with oracle database

    Hello,
    i have a problem to connect my java program with oracle databse.
    i have oracle 8 release. i tried all my best to connect but i
    can't. please help me. whenever i compile JdbcCheckup.java file
    which is distributed with oracle 8 release, it compile successfully.
    but whenever i run JdbcCheckup class file then it will generate an
    exception and that is -
    Exception in thread "main" java.lang.ClassNotFoundException:
    oracle.jdbc.driver.OracleDriver
         at java.lang.class.forname0(native method)
         at java.lang.class.forname(unknown source)
    and some other error message.
    But, by following yours given instruction, first, i unzip CLASSES111.zip
    in file which is distributed with oracle 8 realease in jdbc subdirectory
    into c:\temp directory and then run oracle installer(setup.exe) and point
    the installer to c:\temp and then i install the oracle JDBC drivers(beta)
    7.3.3.1.3 from the jdbc subfolder into oracle installer by selecting
    win95.prd for jdbc subfolder.
    After that i write into my autoexec.bat file,
    path d:\jdk\lib;d:\jdk\bin;c:\windows\command;C:\temp\BIN;c:\temp\jdbc\lib\classes111.zip
    and then i restart the machine and the i complile and run JdbcCheckup file
    But, i can't recognize my error to define class path or installing the
    driver. please help me in details so that i overcome this problem.
    because i am student of B.sc. in CIS of final year. i need to submit
    my project within some days. please reply me as early as possible.
    thanks
    hemonto
    email - [email protected]

    path d:\jdk\lib;d:\jdk\bin;c:\windows\command;C:\temp\BIN;c:\temp\jdbc\lib\classes111.zipYou've added classes111.zip to your PATH, not your CLASSPATH.
    Add it to your CLASSPATH using:
    set CLASSPATH=%CLASSPATH%;c:\temp\jdbc\lib\classes111.zip
    then try to compile/run again.

  • How to connect with the database

    Hi
    I have oracle instant client instantclient-basic-win32-11.1.0.6.0 and i have oracle database 11g installed on oracle enterprise linux machine, i want to connect to that oracle from windows xp machine. i have oracle instantclient-basic-win32-11.1.0.6.0, which has following files.
    vc8
    vc71
    adrci
    adrci
    BASIC_README
    genezi
    genezi
    etc.......
    when i connect using sqlplus TNS adapter error is coming what to do

    Try to follow steps from Quick Start to Oracle Net Connections: http://download.oracle.com/docs/cd/B28359_01/network.111/b28316/gettingstart.htm#i485122

  • How Users Interact with Oracle Database Express Edition in a Network?

    Please i just want to know how users can relate or access the Oracle DB xpress on a network. Coming from an oracle enterprise edition background i know when you install oracle on a network, isqlplus for example is centrally loaded meaning you dont need to install oracle on each machine in the network, so users can access the DB from their nodes. I am presently working in a big estate management firm and i want to create a structured database for them, they use excel to store records and want to introduce Oracle.

    You can access XE remotely through the browser after following the instructions here:
    http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/network.htm#BHCBCFBA
    If you are using APEX as the application, you'd need to do that. There may be other firewall consideration though (ie opening the relevant server ports).
    [There's no isqlplus anymore, but there is a similar sql worksheet in the Apex development environment).
    If you are just using the database as a data store behind, for example, a Java application, then connections will probably be through ODBC/JDBC/OCI and probably need some client installation too.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Getting following error while creating a datasource connection with oracle database.

    I have 32 bit oracle server installed in remote server.
    and 64 bit sql server 2008 r2 report server installed, and 64 bit oracle client installed on my report server  while create a new datasource
    in the report server i am getting this error
    Error 
    Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle
    client components installed
    How can i fix this and let me know the reason

    This link will help you out.
    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/0a38fa00-31de-49de-b68f-4c5a4565e5b1?prof=required
    Milan Das

  • Bypass Login with Oracle Database

    hello,
    I am using Oracle forms 6i.
    i want to create an application that does not require any connection with Oracle database.
    My Application fetch all its data from an Excel file.
    I do not want Login with Database,so i want to byapass it.
    How can i do it..

    Akarsh wrote:
    hello,
    I am using Oracle forms 6i.
    i want to create an application that does not require any connection with Oracle database.
    My Application fetch all its data from an Excel file.
    I do not want Login with Database,so i want to byapass it.
    How can i do it..Hi Akarsh,
    Use ON-Logon trigger at form lebel
    and put your connection string. then when you run this , it will not ask for connection identifier.
    Hope this works..

  • Using php to connect to Oracle Database 11g Release 2 Enterprise Edition

    Greetings everyone!
    Please i dont know how to connect to Oracle Database 11g Release 2 Enterprise Edition with php even though i connected with php successfully with Oracle Database 11g Express Edition with the php code below. can someone help please...
    define('ORA_CON_UN', 'hr'); // User name
    define('ORA_CON_PW', 'Adlibs14$'); // Password
    define('ORA_CON_DB', '//localhost/XE'); // Connection identifier
    // use constants defined in anyco_cn.inc
    $conn = oci_pconnect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
    if (!$conn) {
    db_error(null, __FILE__, __LINE__);
    Edited by: user11273096 on Jul 14, 2011 3:41 PM

    Note that this forum is for XE Beta, not EE.
    Can you connect from some other client tool, such as sqlplus?
    There's a {forum:id=178} forum that may be more suitable, if basic connectivity outside php works (i.e. issue is only php specific).

Maybe you are looking for