What are the advantages of JNDI over JDBC ?

Discussion in 'JNDI' started by revathybuddy, Sep 10, 2009.

  1. revathybuddy

    revathybuddy New Member

    1. What is real of advantages of JNDI over JDBC?
    2. in which situation we use JNDI in projects.
    3. What is the need or purpose of JNDI in projects?

    If anybody people know ... reply..

    Revathy
     
  2. srinivask

    srinivask New Member

    We use JNDI to locate a Naming of an Object in Remote JDBC to Connect the Database that u know well
     
  3. sreenu3112

    sreenu3112 New Member

    By getting Connection object using JNDI we have adavntages

    1. We no need to worry about object creation and destroy after usage.

    2. Performance is more .

    3. No Multithreading issues.
     
  4. rajesh.yedula

    rajesh.yedula New Member

    Hi Guys,

    I am also new to JNDI,i have never used it,Could u give better origination of JNDI who developed it and in web applications how to use it.I would like know entire picture of JNDI with clear cut explanation from people like u.
     
  5. reddy479

    reddy479 New Member

    can any one send me code for getting data from mysql DB and storing in excel sheet...

    can any one send me code for getting data from mysql DB and storing in excel sheet...
     
  6. rajesh.yedula

    rajesh.yedula New Member

    Re: can any one send me code for getting data from mysql DB and storing in excel sheet...

    Hi reddy,

    I don't have any idea regarding this task.I know how to use POI Api to read data from excel sheets,but i never inserted data from DB to excel sheet.
     
  7. madhulika.bhonagiri

    madhulika.bhonagiri New Member

    Hi,

    code to connect to Datasource:

    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setDriverClassName("oracle.jdbc.driver.OracleDriver");
    dataSource.setUrl("jdbc:eek:racle:thin:mad:host naem:portnumber:ServiceName");
    dataSource.setUsername("username");
    dataSource.setPassword("password");
    Connection conn =DataSourceUtils.getConnection(dataSource);

    I added spring.jar.
    Hope this is helpful..

    Regards,
    Madhulika.
     
  8. chinky

    chinky New Member

    JNDI is an API used to interact with directory servers (active directory,LDAP etc.,).
    JDBC is an API used to interact with databases(oracle databas,mysql etc.,).

    Directory servers are in general stores data in tree format where as databases store in table format.
     
  9. JNDI is an api to interact with registry.where we can perform lookup and binding operations.for better understanding about this follow the below notes.

    If a java application needs a connection with a database,then first of all it ll to JNDI registry(look-up operation),to get the DataSource object.DataSource object is stored in the registry by the database administrator.it's not programmers duty.and we call this operation as Binding operation.DataSource always provides proxy connections to the java application by taking them from connection pool.
    for any explanation contact me on this 8142088911.
     
  10. JNDI is an api to interact with registry.where we can perform lookup and binding operations.for better understanding about this follow the below notes.

    If a java application needs a connection with a database,then first of all it ll to JNDI registry(look-up operation),to get the DataSource object.DataSource object is stored in the registry by the database administrator.it's not programmers duty.and we call this operation as Binding operation.DataSource always provides proxy connections to the java application by taking them from connection pool.
    for any explanation contact me on this 8142088911.
     
  11. anneroberts

    anneroberts Member

    1. More Portable.
    2. Code much easier to maintain.
    3. Configuring context.
     

Share This Page