Share on Google+Share on Google+

1 Answer(s)      3 years and 10 months ago
Posted in : Java Beginners

i try to execute this code stmt1.executeUpdate("insert into linktable values('"+rs1+"','"+title+"',"+link2+"','"+date+"')");

and it shows the following error

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 '://','Fri, 17 May 2013 00' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.lang.reflect.Constructor.newInstance( at com.mysql.jdbc.Util.handleNewInstance( at com.mysql.jdbc.Util.getInstance( at com.mysql.jdbc.SQLError.createSQLException( at com.mysql.jdbc.MysqlIO.checkErrorPacket( at com.mysql.jdbc.MysqlIO.checkErrorPacket( at com.mysql.jdbc.MysqlIO.sendCommand( at com.mysql.jdbc.MysqlIO.sqlQueryDirect( at com.mysql.jdbc.ConnectionImpl.execSQL( at com.mysql.jdbc.StatementImpl.executeUpdate( at com.mysql.jdbc.StatementImpl.executeUpdate( at Mydb.main( Java Result: 1 please help me to find the error


View Answers

May 20, 2013 at 11:15 AM

hi friend,

You are missing the single quote in your sql statement before link2 variable.

insert into linktable values('"+rs1+"','"+title+"',"+link2+"','"+date+"')

Try the sql statement below, may this will be helpful for you.

insert into linktable values('"+rs1+"','"+title+"','"+link2+"','"+date+"')


Related Tutorials/Questions & Answers:
mysql-java   i try to execute this code stmt1.executeUpdate("insert... the manual that corresponds to your MySQL server version for the right syntax to use...) at Mydb.main( Java Result: 1 please help me to find the error  
connection with MySQL to java.
connection with MySQL to java.   how to connect MySQL database with jsp
MySql,java  In MySQL table i am adding the fields of name,photo,video,age, the category i have some subjects.if one person login into my-site the he upload the one video under one subject.then i want the following
MYSQL Java Connector Library
Where to download the MYSQL Java Connector Library and get the jar file This article discuss 'how to connect Java and MYSQL using MYSQL connector' in Java. The article will give you view on downloading and installing MYSQL Java
how to connect jsp to mysql - Java Beginners
with mysql .java file is compiled but this not connected with my sql plz anyone help me hw to conncet jsp with mysql this is connection file package to connect jsp to mysql  I m new in Mysql and JSP i m
Mysql & java - JDBC
Mysql & java  Hi guys, please help! I'm new to mysql, I want to connect to mysql 5.1 using java. But it shows error about: Class.forName...) { System.out.println("MySQL Connect Example."); Connection conn = null
jsp, mysql - Java Beginners
jsp, mysql  i want to store / insert the selected value in the combo box (jsp), into the mysql. how to do it?... pls help me in urgent
jdbc driver for mysql - Java Beginners
jdbc driver for mysql  I need jdbc driver program for connecting java progrma to mysql. Please any one send me the url to download the driver... of jdbc-mysql database connectivity and idea about jdbc and mysql driver
Login authentication & mysql - Java Beginners
Authentication with MySql using Java Swing: 1)Create a java class... their personal account with the username and password, must save it in database (MySQL... with the data in database. I am newbies to java & learning java by myself but I
website creation using java and mysql - Java Beginners
website creation using java and mysql  i am going to create a website for some company using java and mySql... i dont know the procedure to create a website.can anybody give me the steps what i have to follow
JDBC Example with MySQL
; Mapping MySQL Data Types in Java Data types of MySQL... Java data types. Connecting to a MySQL Database in Java In this section, you will learn how to connect the MySQL database with Java file. We need
Mapping MySQL Data Types in Java
Mapping MySQL Data Types in Java    ... types of MySQL and Java programming language are not same, its need some... MySQL statements. There is no particular reason that the Java data type
Java Mysql Connection Example
Java Mysql Connection Example We are going to discus how to connect  MySQL in java. We have been provide some classes and API with which we will make... in Java MySQL should be installed in your computer. MySQL connector JAR
My SQL  Connection class for MySQL in java
Servlets mysql connectivity
Servlets mysql connectivity  please tell me the steps to connect mysql with java servlets using connector j
question  Good Afternoon, code to display the employees on leave,and approve that leave for manager.using JPanel+mysql+Java
Mine Problem
Mine Problem  how to view a row from a table created in mysql in a java swing application
java-mysql  how i retrive all the values of a table in mysql to java forms or java table
question  i need to select data from database using mysql+java script+html   Please specify some more details
question  Good Morning Sir, submit attendance to database using system IP address with current system date and time.using JPanel+mysql+Java
question  Good Afternoon Sir, give me the source code to submit attendance to data base using System IP Address with system date and time.using JPanel+mysql+java
question  Good after noon Sir, Please send me the code of the problem given's urgent code to display employees on absent and manager can approve,and send a notification message to an employee.using JPanel+mysql+Java
retrive mails - Java Beginners
retrive mails   hi how to retrive mails using mysql in java not using pop3 or imap directly from database i am using dbfile system in james server.header should be store in database and message in file system thanks bala
JDBC - Java Beginners
JDBC   To connect java with mysql database i used the proper class... as "class not found error". Is there any steps to connect mysql with java... where your mysql connector jar file available thats allj ar file name = mysql
MySQL connectivity - JDBC
MySQL connectivity  hi all, i am not able to connect Mysql to java i connect it ..i am getting the error ..saying classNotFoundException... to "com.mysql.jdbc.Driver" class not found In the lib folder "mysql-connector-java-5.0.6-bin.jar
regarding jdbc - JDBC
regarding jdbc  how to connect mysql with java example you have provided is having some error and i am not able to remove that error please... = DriverManager.getConnection("jdbc:mysql://localhost:3306/yourdatabase", "your username", "your
Mysql Date To Java Date
Mysql Date To Java Date       Mysql Date To Java Date retrieve the records from Mysql and display... 'Mysql Date To Java Date'. To understand and grasp the example we create a table
Java Spring Hibernate Struts Training What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? file location SASLError using PLAIN: not-authorized how to convert war file into .exe file using java code


Advertisement null