Results 1 to 4 of 4
Thread: connection database
- 01-10-2012, 07:29 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 1
- Rep Power
- 0
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>
- 02-28-2013, 09:57 AM #2
Member
- Join Date
- Feb 2013
- Posts
- 1
- Rep Power
- 0
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 02:06 PM. Reason: Removed spammy link
- 02-28-2013, 12:36 PM #3
Godlike
- Join Date
- Nov 2012
- Posts
- 195
- Rep Power
- 1
Re: connection database
Sorry, I couldn't resist :)
- 02-28-2013, 02:07 PM #4
Similar Threads
-
connection to database
By manojkumarsahu in forum New To JavaReplies: 1Last Post: 08-06-2010, 09:26 PM -
connection to database
By buston01 in forum JDBCReplies: 4Last Post: 02-21-2010, 01:32 AM -
Database Connection
By CompleteBeginner in forum New To JavaReplies: 2Last Post: 05-24-2008, 02:30 PM -
Database Connection
By vipinkumarsolanki in forum Advanced JavaReplies: 2Last Post: 11-26-2007, 06:36 AM -
Database connection
By oaklander in forum New To JavaReplies: 2Last Post: 11-12-2007, 11:11 PM


LinkBack URL
About LinkBacks

Bookmarks