15,900,815 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 11820084 (Top 9 by date)
Member 11820084
8-Jul-15 8:53am
View
Ok, no problem.It is up to you !Thanks for your help!
try to debugging routine,I find out that i can not get "ac".It is something wrong with my applicationContext,xml ? I chhecked overandover.
public class PassengerDaoTest {
@Test
public void test1(){
System.out.println("PassengerDaoTest");
String conf = "applicationContext.xml";
ApplicationContext ac =
new ClassPathXmlApplicationContext(conf);
System.out.println(ac);
Member 11820084
8-Jul-15 7:13am
View
Can you tell me your email.I saw your summary.
I was a Software Support Engineer for many years using various legacy enterprise systems before learning UNIX and Windows programming - the latter largely in my own time. In my last few years of employment I spent more time in actual development.
Since retiring I have been learning some of the newer technologies (C#, .NET, WPF, LINQ, SQL ...) that I never used in my professional life, and am actually able to understand some of it.
One day I hope to become a real programmer.
I think i agree with your last sentence.Steve Jobs say:Stay hungry Stay foolish.
Your spirit inspires me.
I admire you a lot.I want to make friend! Thanks!
Member 11820084
8-Jul-15 6:27am
View
ok ,debugging.....
Member 11820084
8-Jul-15 6:25am
View
<context:component-scan
="" base-package="org.ctw.tabs">
<bean id="template"
="" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionfactory">
</property>
<bean id="sessionfactory"
="" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dbcp">
</property>
<property name="mappingLocations">
<list>
<value>org/ctw/tabs/entity/hbm/Passenger.hbm.xml
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">true</prop>
</props>
</property>
<bean id="dbcp" class="org.apache.commons.dbcp.BasicDataSource">
<property name="username" value="root">
</property>
<property name="password" value="root">
</property>
<property name="url" value="jdbc:mysql:///t_abs">
</property>
<property name="driverClassName" value="com.mysql.jdbc.Driver">
</property>
Member 11820084
8-Jul-15 5:58am
View
Deleted
1
Member 11820084
8-Jul-15 5:57am
View
package org.ctw.tabs.dao.test;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.ctw.tabs.common.AbsConstant;
import org.ctw.tabs.dao.PassengerDao;
import org.ctw.tabs.entity.Passenger;
public class PassengerDaoTest {
@Test
public void test1(){
String conf = "applicationContext.xml";
ApplicationContext ac = //line 15 Resource leak: 'ac' is never closed
new ClassPathXmlApplicationContext(conf);
PassengerDao dao =
ac.getBean("passengerDao",PassengerDao.class);
Passenger passenger = new Passenger();
passenger.setPsg_name("scott");
passenger.setPsg_certif_type("passport");
passenger.setPsg_certif_num("123456789");
passenger.setPsg_type(AbsConstant.PASSENGER_TYPE_MEN);
passenger.setRef_user_id(1);
dao.save(passenger);
}
}
Member 11820084
8-Jul-15 5:50am
View
Deleted
1
Member 11820084
8-Jul-15 5:45am
View
Thanks! I will try ! I think maybe lost some of *.jar in the lib document.Now checking.....
I copy my code,please help me to find out the worng thing.
Member 11820084
8-Jul-15 5:12am
View
Deleted
1
Show More