package image
import java.util.ArrayList
import java.util.HashMap
import java.util.List
import java.util.Map
public class Movie3
{
int movieId
String movieName
double price
public Movie3 ( int movieId, String movieName, double price )
{
this.movieId = movieId
this.movieName = movieName
this.price = price
}
public int getID ()
{
return movieId
}
public String getMovieName ()
{
return movieName
}
public double getPrice ()
{
return price
}
@Override
public String toString ()
{
StringBuilder builder = new StringBuilder ()
builder.append ("Movie3 [movieId=")
builder.append (movieId)
builder.append (", movieName=")
builder.append (movieName)
builder.append (", price=")
builder.append (price)
builder.append ("]")
return builder.toString ()
}
public static void main ( String[] args )
{
Movie3 a = new Movie3 (1, "冰雪奇缘", 40)
Movie3 b = new Movie3 (2, "美国队长2", 40)
Movie3 c = new Movie3 (3, "大闹天宫", 50)
Movie3 d = new Movie3 (4, "卑鄙的我2", 50)
List sciencemovieDVDList = new ArrayList ()
List AnimationmovieDVDList = new ArrayList ()
sciencemovieDVDList.add (b)
sciencemovieDVDList.add (c)
AnimationmovieDVDList.add (a)
AnimationmovieDVDList.add (d)
Map movies = new HashMap ()
movies.put ("科幻电影", sciencemovieDVDList)
movies.put ("动漫电影", AnimationmovieDVDList)
System.out.println ("键的集合" + movies.keySet ())
System.out.println ("键-值对集合:" + movies)
String key = "科幻电影"
if (movies.containsKey (key))
{
System.out.println ("键“" + key + "”对应的值:" + movies.get (key))
}
movies.remove (key)
System.out.println ("键-值”对集合:" + movies)
}
}
queryForList没有,看不出来,你先debug一下,看看你从数据库中取出来的值是什么。
在你对应的库里面执行
SELECT '2013年第3月' showdate, COUNT(id) num FROM table
看看结果是什么。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)