SchedDao.java ( File view )

  • By lnsoftware 2014-09-17
  • View(s):540
  • Download(s):10
  • Point(s): 3
			

package com.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.sql.Date;
import java.util.Calendar;


public class SchedDao 
{

    // inset 将Sched对象中的值插入到航班信息表中
        public int inset(Connection connection,Sched sch)
	{

		int value=-1;
		PreparedStatement statement=null;
		String sql="insert into sch(Hao,Qifei,Mudi,Jiage,Piaosu) value(?,?,?,?,?)";
		try
		{

			statement=connection.prepareStatement(sql);
			statement.setString(1,sch.getHao());
			statement.setString(2,sch.getQifei());
			statement.setString(3,sch.getMudi());
			statement.setInt(4,sch.getJiage());
			statement.setInt(5,sch.getPiaosu());
			value=statement.executeUpdate();
                        return value;
		
}
		catch (SQLException e)
		{

		
}
		finally
		{

			try
			{

				if(statement!=null)statement.close();
			
}
			catch (SQLException ee)
			{

			
}
		
}
		return value;
	
}
        // check 修改该航班号的日期时间
         public int check(Connection connection,Anpai anpai)
	{

		int value=-1;
		PreparedStatement statement=null;
		String sql="update sch set Rqi=? where Hao=?";
		try
		{

			statement=connection.prepareStatement(sql);
			statement.setDate(1,anpai.getRqi());
			statement.setString(2,anpai.getHao());
			value=statement.executeUpdate();
                        return value;
		
}
		catch (SQLException e)
		{

		
}
		finally
		{

			try
			{

				if(statement!=null)statement.close();
			
}
			catch (SQLException ee)
			{

			
}
		
}
		return value;
	
}
         // quest 获得所有航班的信息
        public ArrayList quest(Connection connection)
        {

            ArrayList array=new ArrayList();
            //查询所有定制航班的信息
            // 将查询出的值放入ArrayList动态数组中返回
            String sql="select Hao,Qifei,Rqi,Mudi,Jiage,Piaosu from sch ";
            Statement statement=null;
            ResultSet resultset=null;
            try
            {

                    statement=connection.createStatement();
                    resultset=statement.executeQuery(sql);
                    while(resultset.next())
                    {

                        Sched sch=new Sched();
                        sch.setHao(resultset.getString("Hao"));  
                         sch.setRqi(resultset.getString("Rqi"));
                        sch.setQifei(resultset.getString("Qifei"));
                        sch.setMudi(resultset.getString("Mudi"));
                        sch.setJiage(resultset.getInt("Jiage"));
                        sch.setPiaosu(resultset.getInt("Piaosu"));
                        array.add(sch);
                    
}
                    return array;
                    
            
}
            catch(SQLException e)
            {

                
            
}
            finally
            {

                try
                {

                    if(statement!=null) statement.close();
                    if(resultset!=null) resultset.close();
                
}
                catch(SQLException ee)
                {

                    
                
}
            
}
            return array;
            
        
}
        // descry 查询已经安排日期的航班
        // 将航班信息放入 ArrayList动态数组中
        public ArrayList descry(Connection connection)
        {

            ArrayList array=new ArrayList();
            String sql="select Hao,Qifei,Rqi,Mudi,Jiage,Piaosu from sch where Rqi is not null";
            Statement statement=null;
            ResultSet resultset=null;
            try
            {

                    statement=connection.createStatement();
                    resultset=statement.executeQuery(sql);
                    while(resultset.next())
    
...
...
(Please download the complete source code to view)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 3

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
01.97 kB
.classpath455.00 B2009-12-20|11:30
01.97 kB
.mymetadata303.00 B2010-02-01|11:15
.project1.20 kB2009-12-20|11:32
01.97 kB
org.eclipse.jdt.core.prefs330.00 B2009-12-20|11:29
01.97 kB
Adminlogin.jsp3.75 kB2009-12-20|11:36
01.96 kB
MANIFEST.MF39.00 B2009-12-20|11:30
context.xml67.00 B2009-12-20|11:30
01.97 kB
01.96 kB
01.96 kB
01.97 kB
Anpai.class833.00 B2010-02-01|11:15
DinDao.class8.21 kB2010-02-01|11:15
Sched.class1.50 kB2010-02-01|11:15
SchedDao.class4.42 kB2010-02-01|11:15
Tocom.class644.00 B2010-02-01|11:15
User.class1.49 kB2010-02-01|11:15
UserDao.class3.97 kB2010-02-01|11:15
01.97 kB
AdminServlet.class2.14 kB2010-02-01|11:15
AffirmServlet.class2.55 kB2010-02-01|11:15
ArrangeServlet.class2.47 kB2010-02-01|11:15
DestineServlet.class2.08 kB2010-02-01|11:15
ExamineSerlvet.class1.95 kB2010-02-01|11:15
FlightServlet.class2.31 kB2010-02-01|11:15
HavingServlet.class1.81 kB2010-02-01|11:15
InterServlet.class1.82 kB2010-02-01|11:15
IntercalateServlet.class1.83 kB2010-02-01|11:15
LoginServlet.class2.00 kB2010-02-01|11:15
ModifyServlet.class2.34 kB2010-02-01|11:15
NewUser.class2.32 kB2010-02-01|11:15
NoparamServlet.class2.38 kB2010-02-01|11:15
PassServlet.class2.35 kB2010-02-01|11:15
PurchaseServlet.class2.60 kB2010-02-01|11:15
RecedServlet.class2.82 kB2010-02-01|11:15
RecedeServlet.class2.39 kB2010-02-01|11:15
SchedServlet.class2.21 kB2010-02-01|11:15
01.97 kB
JDBconne.class1.04 kB2010-02-01|11:15
config.properties62.00 B2009-12-20|11:30
01.96 kB
mysql-connector-java-5.0.8-bin.jar528.18 kB2009-12-20|11:30
web.xml7.14 kB2010-02-01|11:17
adminMain.jsp1.11 kB2009-12-20|11:30
adminfaild.jsp3.06 kB2009-12-20|11:34
affirmfaild.jsp1.25 kB2009-12-20|11:30
affirmfailder.jsp1.26 kB2009-12-20|11:30
affirmflight.jsp2.71 kB2009-12-20|11:30
amenderror.jsp1.24 kB2009-12-20|11:30
amendfail.jsp1.24 kB2009-12-20|11:30
amendsucceed.jsp1.25 kB2009-12-20|11:30
arrangBlest.jsp1.08 kB2009-12-20|11:30
arrangFaild.jsp1.08 kB2009-12-20|11:30
arrangTime.jsp9.62 kB2009-12-20|11:30
destineflight.jsp2.16 kB2009-12-20|11:30
estaBlest.jsp1.08 kB2009-12-20|11:30
estaFaild.jsp1.08 kB2009-12-20|11:30
estaflight.jsp4.15 kB2009-12-20|11:30
examFlight.jsp2.03 kB2009-12-20|11:30
examineshopping.jsp2.27 kB2009-12-20|11:30
index.html5.12 kB2009-12-20|11:34
info.jsp4.65 kB2009-12-20|11:30
infoblest.jsp1.20 kB2009-12-20|11:30
infofaild.jsp1.23 kB2009-12-20|11:30
01.97 kB
1.jpg8.95 kB2009-12-20|11:30
12d.JPG3.47 kB2009-12-20|11:30
2.jpg6.21 kB2009-12-20|11:30
3.jpg9.71 kB2009-12-20|11:30
Thumbs.db188.00 kB2009-12-20|11:30
{1F427A01-3094-4793-BECB-181BB279573B}0.jpg20.42 kB2009-12-20|11:30
{E06BF7D3-2732-4CA1-B9F0-493FA68F883B}.BMP65.97 kB2009-12-20|11:30
{E8940ACA-D0B5-4E0A-AF43-AB4D68987F54}.BMP11.95 kB2009-12-20|11:30
intercaTime.jsp9.74 kB2009-12-20|12:02
login.jsp4.09 kB2009-12-20|11:34
loginfaild.jsp3.38 kB2009-12-20|11:34
passwordamend.jsp3.52 kB2009-12-20|11:30
recedeticket.jsp2.74 kB2009-12-20|11:30
recedfaild.jsp1.23 kB2009-12-20|11:30
register.jsp10.73 kB2009-12-20|11:34
registerblest.jsp3.19 kB2009-12-20|11:34
registerfaild.jsp3.19 kB2009-12-20|11:34
userMain.jsp1.13 kB2009-12-20|11:30
01.96 kB
01.96 kB
01.97 kB
Anpai.java444.00 B2009-12-20|11:30
DinDao.java14.81 kB2009-12-20|11:30
Sched.java1.00 kB2009-12-20|11:30
SchedDao.java5.72 kB2009-12-20|11:30
Tocom.java485.00 B2009-12-20|11:30
User.java1.06 kB2009-12-20|11:30
UserDao.java5.30 kB2009-12-20|11:33
01.97 kB
AdminServlet.java1.69 kB2009-12-20|11:30
AffirmServlet.java2.22 kB2009-12-20|11:30
ArrangeServlet.java2.01 kB2009-12-20|11:30
DestineServlet.java1.70 kB2009-12-20|11:30
ExamineSerlvet.java1.31 kB2009-12-20|11:30
FlightServlet.java2.01 kB2009-12-20|11:30
HavingServlet.java1.30 kB2009-12-20|11:30
InterServlet.java1.28 kB2009-12-20|11:30
IntercalateServlet.java1.30 kB2009-12-20|11:30
LoginServlet.java1.75 kB2009-12-20|11:30
ModifyServlet.java1.87 kB2009-12-20|11:30
NewUser.java1.97 kB2009-12-20|11:30
NoparamServlet.java2.00 kB2009-12-20|11:30
PassServlet.java2.14 kB2009-12-20|11:30
PurchaseServlet.java2.21 kB2009-12-20|11:30
RecedServlet.java2.28 kB2009-12-20|11:30
RecedeServlet.java2.05 kB2009-12-20|11:30
SchedServlet.java1.76 kB2009-12-20|11:30
01.97 kB
JDBconne.java1.02 kB2009-12-20|11:30
01.97 kB
mybirger.sql2.20 kB2010-02-02|16:18
...
Sponsored links

SchedDao.java (804.81 kB)

Need 3 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D