最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

測(cè)試 新增女神 方法報(bào)錯(cuò)!

錯(cuò)誤信息:

Exception in thread "main" com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'values('小夏', 1, 22, '2016-05-13', 'xiaoxiaxia@163.com', '13988886666', 'ad' at line 1

Hello 各位,以上是錯(cuò)誤信息,晚上卡在這里了。按照信息提示,我檢查了 sql 語(yǔ)句,但還是找不到錯(cuò)誤在哪里。請(qǐng)大家?guī)臀覚z查下!

以下為?DAO?部分的代碼:
public?class?GoddessDao?{

	public?void?addGoddess(Goddess?g)?throws?Exception?{
		Connection?conn?=?DBUtil.getConnection();
		String?sql?=?"insert?into?imooc_goddess"?+?"("?+?"user_name,?sex,?age,?birthday,?email,?mobile,?"
				+?"create_user,?create_date,?update_user,?update_date,?isdel"?+?")"?+?"values("
				+?"?,??,??,??,??,??,??,?current_date(),??,?current_date(),??)";
		java.sql.PreparedStatement?ptmt?=?conn.prepareStatement(sql);

		ptmt.setString(1,?g.getUser_name());
		ptmt.setInt(2,?g.getSex());
		ptmt.setInt(3,?g.getAge());
		ptmt.setDate(4,?new?Date(g.getBirthday().getTime()));
		ptmt.setString(5,?g.getEmail());
		ptmt.setString(6,?g.getMobile());
		ptmt.setString(7,?g.getCreate_user());
		ptmt.setString(8,?g.getUpdate_user());
		ptmt.setInt(9,?g.getIsdel());

		ptmt.execute();

	}
以下為?action?部分的代碼:
public?class?GoddessAction?{
	public?static?void?main(String[]?args)?throws?Exception?{
		
		GoddessDao?gd?=?new?GoddessDao();
		
		Goddess?g1?=?new?Goddess();
		g1.setUser_name("小夏");
		g1.setSex(1);
		g1.setAge(22);
		g1.setBirthday(new?Date());
		g1.setEmail("xiaoxiaxia@163.com");
		g1.setMobile("13988886666");
		g1.setCreate_user("admin");
		g1.setUpdate_user("admin");
		g1.setIsdel(1);
		
		gd.addGoddess(g1);


正在回答

1 回答

找到錯(cuò)誤了:

DAO 部分的代碼 values 后面的左半括號(hào)寫(xiě)成中文字符的括號(hào)了。。??匏?:(

???String?sql?=?"insert?into?imooc_goddess"?+?"("?+?"user_name,?sex,?age,?birthday,?email,?mobile,?"
????????????????+?"create_user,?create_date,?update_user,?update_date,?isdel"?+?")"?+?"values(???<-----看到?jīng)],就是它,寫(xiě)成中文括號(hào)了;低級(jí)小錯(cuò)誤害死人"
????????????????+?"?,??,??,??,??,??,??,?current_date(),??,?current_date(),??)";


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

測(cè)試 新增女神 方法報(bào)錯(cuò)!

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)