Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


Naithan
mysql-java
1 Answer(s)      11 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 '://www.publishersweekly.com/pw/by-topic/authors/index.html','Fri, 17 May 2013 00' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:525) at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) at com.mysql.jdbc.Util.getInstance(Util.java:386) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1749) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1666) at Mydb.main(Mydb.java:111) Java Result: 1 please help me to find the error


Advertisement
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+"')

Thanks.



Related Tutorials/Questions & Answers:
mysql-java
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(Mydb.java:111) 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
Advertisements
MySql,java
MySql,java  In MySQL table i am adding the fields of name,photo,video,age,category.in 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 connect...how 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
Mapping MySQL Data Types in Java
Mapping MySQL Data Types in Java       Data types of MySQL and Java programming language... using MySQL data types and a application using Java data types. We need to provide
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
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
My SQL  Connection class for MySQL in java
java-mysql
java-mysql  how i retrive all the values of a table in mysql to java forms or java table
Mine Problem
Mine Problem  how to view a row from a table created in mysql in a java swing application
question
question  Good Afternoon, code to display the employees on leave,and approve that leave for manager.using JPanel+mysql+Java
Servlets mysql connectivity
Servlets mysql connectivity  please tell me the steps to connect mysql with java servlets using connector j
question
question  Good Morning Sir, submit attendance to database using system IP address with current system date and time.using JPanel+mysql+Java
question
question  i need to select data from database using mysql+java script+html   Please specify some more details
question
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
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
question
question  Good after noon Sir, Please send me the code of the problem given below.it's urgent code to display employees on absent and manager can approve,and send a notification message to an employee.using JPanel+mysql+Java
MySQL connectivity - JDBC
MySQL connectivity  hi all, i am not able to connect Mysql to java ..as 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
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
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
jdbc - Java Beginners
is: Expert:Jagadeesh To connect java with mysql database i used the proper class... error". Is there any steps to connect mysql with java before running. ---Answers Hello friend inside your project set the class path where your mysql connector
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
Count Rows from a Database Table
: For this program to work firstly we need to establish the connection with MySQL... ("jdbc:mysql://localhost:3306/jdbctutorial","root","... CountRows.java C:\vinod\jdbc\jdbc\jdbc-mysql>java CountRows
Creating a Database in MySQL
Creating a Database in MySQL       After establishing the connection with MySQL database by using.... In this example we are going to create a  database by MySQL and with the help
Getting Column Names from a database table in Java
Getting Column Names from a database table in Java  ... this program is going to do. Strictly follow the naming conventions of java. Now declare a static method inside which creates the connection with MySQL database through
Delete a Column from a Database Table
;);   con = DriverManager.getConnection ("jdbc:mysql...\jdbc\jdbc\jdbc-mysql>java DeleteColumn Delete columns example
Join tables with the NATURAL LEFT JOIN operation
of program: In this program we are going to establish the connection with MySQL...;= DriverManager.getConnection ("jdbc:mysql://localhost:3306/jdbctutorial"...\jdbc\jdbc\jdbc-mysql>java NatLeftJoinTable Natural Left Join Tables
Join tables with the NATURAL RIGHT JOIN operation
, this program establishes connection with MySQL database through the JDBC...;DriverManager.getConnection ("jdbc:mysql://localhost:3306/jdbctutorial","root"... NatRightJoinTable.java C:\vinod\jdbc\jdbc\jdbc-mysql>java NatRightJoinTable
Cross Join Tables in a Specific Database
;con = DriverManager.getConnection ("jdbc:mysql://localhost...:\vinod\jdbc\jdbc\jdbc-mysql>java CrossJoinTable Natural Left Join Tables
Set Data Types by using Prepared Statement
) in the PreparedStatement interface of java.sql package. We know that the data types of MySQL and java... the data to each other Java and MySQL. Mapping between both java and MySQL... to it's nature that is supported by both java and MySQL. Data is then added
Prepared Statement Set Big Decimal
data types MySQL and Java programming language are not same. So mapping between... data type in java to integrate in MySQL through the help of NUMERIC and DECIMAL... to establish the connection with MySQL database by using the JDBC driver. After
Make Unique Column in Database Table
is executed with the help of some java methods. If column name becomes unique... ("jdbc:mysql://localhost:3306/jdbctutorial","root","...\jdbc\jdbc\jdbc-mysql>java MakeUniqueColumn Make unique column example
Remove Unique Column in Database Table
the connection with MySQL database by using the JDBC drive, only after...;);   con = DriverManager.getConnection ("jdbc:mysql... C:\vinod\jdbc\jdbc\jdbc-mysql>java RemoveUniqueColumn
Arrange a Column of Database Table
in ascending order with the help of some java method and APIs. See detailed... the connection with the MySQL database. After the connection has been established we...;DriverManager.getConnection ("jdbc:mysql://localhost:3306/jdbctutorial","
Sum of Column in a Database Table
is to establish the connection with MySQL database by using the JDBC driver...;con = DriverManager.getConnection ("jdbc:mysql://localhost... C:\vinod\jdbc\jdbc\jdbc-mysql>java SumColumn Sum of the specific
Connecting to a MySQL Database in Java
Connecting to a MySQL Database in Java   ... will learn how to connect the MySQL database with the Java file. Firstly, we need to establish a connection between MySQL and Java files with the help of MySQL
Arrange a Column of Database Table
with MySQL database. As soon as the connection gets established it takes a table...:mysql://localhost:3306/jdbctutorial","root","root"...;java ColumnDescOrder Descending order example! Enter table name
How To Store HTML img Into The MySQL Using Java
How To Store HTML img Into The MySQL Using Java In this section you will read... jquery, Ajax, MySQL and we will create a JSP for writing the Java code... the image into the database using MySQL in Java. In this example I have created a JSP
Using WHERE Clause in JDBC
;= "jdbc:mysql://localhost:3306/";  String dbName ...;} } Description of programThis program making the connection between MySQL database and java with the help of many types of APIs interfaces. When
Get Column Count using ResultSet in SQL
;} } Java Database Connectivity Steps1.ConnectionAn interface in java.sql package that provides connection with the database like- MySQL and java files...;url = "jdbc:mysql://localhost:3306/";   String 
 

 

 

DMCA.com