java mysql数据库的连接

来源:百度知道 编辑:UC知道 时间:2024/05/06 20:28:08
我用eclipse 和mysql做一个登录的程序,我在mysql的那个黑色的界面下创建了一个数据库并建了一个表,之后在eclipse里面进行连接但是老是出现以下错误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 '[B@10a3b24' at line 1
后面还有很长一串,是不是我没有把数据库的位置指明,应该怎么做,谢谢!

估计是你写的sql语句有问题了
最好吧代码贴出来啊

例子:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.io.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>display message</title>

<%

String url="jdbc:mysql://localhost:3306/shujukuming";

try{
Class.forName("com.mysql.jdbc.Driver");
Connection dcon=DriverManager.getConnect