Results 1 to 4 of 4
  1. #1
    masoudy is offline Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    0

    Default connection database

    i download sample from internet but it is not compelet
    i can not connection to database i have applicationContext.xml
    but i need other file for complete configuration and define database i leave applicationContext.xml pease complete or add other xml file


    :
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
    Index of /schema/beans
    http://www.springframework.org/schem...-beans-3.0.xsd
    Index of /schema/context
    http://www.springframework.org/schem...ontext-3.0.xsd
    Index of /schema/util
    http://www.springframework.org/schem...g-util-3.0.xsd
    Index of /schema/aop
    http://www.springframework.org/schem...ng-aop-3.0.xsd
    Index of /schema/jee
    http://www.springframework.org/schem...ng-jee-3.0.xsd
    Index of /schema/tx
    http://www.springframework.org/schem...ing-tx-3.0.xsd
    ">

    <aop:aspectj-autoproxy />

    <context:component-scan base-package="chapter09.code.listing" />

    <jee:jndi-lookup jndi-name="java:comp/env/jdbc/myportalDB"
    id="dataSource" />

    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" >
    <property name="dataSource">
    <ref bean="dataSource" />
    </property>
    </bean>

    <tx:annotation-driven transaction-manager="txManager"/>

    <bean id="txManager"
    class="org.springframework.jdbc.datasource.DataSou rceTransactionManager">
    <property name="dataSource" ref="dataSource" />
    </bean>

    <bean id="auditFieldAspect" class="chapter09.code.listing.base.AuditAspect" />
    <bean id="loggingAspect" class="chapter09.code.listing.base.LoggingAspect" />
    </beans>

  2. #2
    emmawatson77 is offline Member
    Join Date
    Feb 2013
    Posts
    1
    Rep Power
    0

    Default Re: connection database

    <?php
    // Create connection
    $con=mysqli_connect("example.com","peter","abc123" ,"my_db");

    // Check connection
    if (mysqli_connect_errno($con))
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
    ?>

    This is the best way to make a database connection . .

    [Moderator edit: link removed]
    Last edited by DarrylBurke; 02-28-2013 at 03:06 PM. Reason: Removed spammy link

  3. #3
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    990
    Rep Power
    2

    Default Re: connection database

    Sorry, I couldn't resist :)


  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: connection database

    Thread closed. Any more spammy links from emmawatson77 and the member will be banned and reported to an anti-spam service.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. connection to database
    By manojkumarsahu in forum New To Java
    Replies: 1
    Last Post: 08-06-2010, 10:26 PM
  2. connection to database
    By buston01 in forum JDBC
    Replies: 4
    Last Post: 02-21-2010, 02:32 AM
  3. Database Connection
    By CompleteBeginner in forum New To Java
    Replies: 2
    Last Post: 05-24-2008, 03:30 PM
  4. Database Connection
    By vipinkumarsolanki in forum Advanced Java
    Replies: 2
    Last Post: 11-26-2007, 07:36 AM
  5. Database connection
    By oaklander in forum New To Java
    Replies: 2
    Last Post: 11-13-2007, 12:11 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •