Challenges spring master

Category: Java EE
 
sunnilyyyboy
2008-12-31 11:49:27

Sponsored Links
Do not talk nonsense

code affixed ................

public int addShop (final Shop shop) {
final String sql = "insert into shop (name, tel, text, keeper, address, vallageid, time) values" +
"(?,?,?,?,?,?,?)";
KeyHolder keyHolder = new GeneratedKeyHolder ();
jdbcTemplate.update (new PreparedStatementCreator () {

public PreparedStatement createPreparedStatement (Connection con)
throws SQLException {
PreparedStatement ps = con.prepareStatement (sql, new String [] {"id"} );
ps.setString (1, shop.getName ());
ps.setString (2, shop . getTel ());
ps.setInt (3, shop.getText ());
ps.setInt (4 , shop.getKeeper ());
ps.setString (5, shop.getAddress ());
ps . setInt (6, shop.getVallageid ());
ps.setString (7, shop.getTime ());
; return ps;
}
}, keyHolder);
int generatedId = keyHolder.getKey (). intValue ();
System.out.println (generatedId + "=============");
return generatedId;
}

when I joined the eighth argument when it is not inserted into the seven or less no problem, perfectly executed


Sponsored Links

sarch0516
2008-12-31 11:55:36
does not paste error message. . .
sgsope
2008-12-31 12:12:57
sql above you, only seven? Section 8 you let him put the question to say which of

fart relationship with spring
peak_tang
2008-12-31 12:26:57


+1
your placeholder only 7, Section 8, of course you put error
chen10845
2008-12-31 12:33:40
not understood are you doing! You'll see an error on eight parameters Lane is Shane?
fenlongkkk001001
2008-12-31 12:41:08
and spring God horse relationship?
fyb0920
2008-12-31 12:59:15
courage to come facie, the results speechless. . .
zl289766189
2008-12-31 01:10:58


same solution.
sky2009d
2008-12-31 01:13:51
sql statement is only 7? Parameters, why give it a eighth parameter
smaimm
2008-12-31 01:15:53
Legend of header files Mody. . . Scared me
ZS1988CN
2008-12-31 01:35:22
spring wool relationship
liyuereneilu
2008-12-31 01:50:50


I also read the title, the courage to come see Ha Son, the results embarrassing the
njxz1
2008-12-31 01:59:02

+1, scared into a cold sweat
huashao1984
2008-12-31 02:12:18
think that is what a big problem. . . . . . . .
lixiaoyangyang
2008-12-31 02:20:08
Landlord title party haha ​​
woaiwqwoaiwq
2008-12-31 02:24:37
this big joke. . .
leon_wang_ndsc
2008-12-31 02:33:35
good forum overbearing from Nikkei stickers affixed to the steering
this be considered progress which ...
fenfenda
2008-12-31 02:36:25


.. ..
huoyue1990
2008-12-31 02:50:03
?,?,?,?,?,?,?) "; against seven parameters, if you can first eight parameters then a miracle happened, you big cow
piaoyicc
2008-12-31 03:01:05

+1
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.

Page 1 of 2    «»