error : not an sql expression statement

error : not an sql expression statement

hii I am gettin followin error in connecting to database SQLserver 2005 in Jdeveloper,i m usin struts and jsp my pogram:

import java.sql.*;

public class TaskBO 
{
  public TaskBO()
  {
  }
 public boolean createtask(Taskdata taskdata) 
  {
    try 
    {
      Connection conn = DatabaseManager.getConnection();
      Statement stmt = conn.createStatement();
      String query = "insert into dbo.guru VALUES('"+taskdata.getTaskid() +"','" + taskdata.getTaskname() +"','"+taskdata.getDateOfBirth();"')";
      boolean result = stmt.execute(query);
      stmt.close();

    } catch (Exception ex) 
    {
      ex.printStackTrace();
    }


    return true;
  }
  }
View Answers

Ads









Related Tutorials/Questions & Answers:
error : not an sql expression statement
error : not an sql expression statement  hii I am gettin followin error in connecting to database SQLserver 2005 in Jdeveloper,i m usin struts... { Connection conn = DatabaseManager.getConnection(); Statement stmt
SQL And Statement
SQL AND Statement       The SQL AND operator is used to show you the filter records... with Example The Tutorial illustrates an example from SQL AND Statement
Advertisements
Need SQL Statement
IS THE SQL STATEMENT NEEDED TO ACHIEVE THESE RESULTS...Need SQL Statement  QUESTION IS CAPITALIZED AT THE BOTTOM... There is a table Employee, with three columns: Name (varchar), Department (varchar
Select Statement in SQL, SQL Tutorial
The SELECT statement for SQL       SELECT key word is used to select data from a table.  Syntax:           SELECT column_name(s
SQL SELECT DISTINCT Statement
SQL SELECT DISTINCT Statement     ... with the select statement. The SQL Distinct clause is used with the Select statement...'. SQL statement to create table:     create table Stu
SQL STATEMENT in JDBC in NETBEANS IDE
SQL STATEMENT in JDBC in NETBEANS IDE  Iam using NETBEANS IDE. Iam developing a bank application. Using JDBC in SERVLETS For the withdraw function, "bal" and "ano" are user inputs when i wrote like, st.executeQuery("UPDATE
The UPDATE Statement, SQL Tutorial
The UPDATE Statement       The UPDATE statement is used to modify the data in the database table through a specified criteria. In the given syntax of update statement the keyword SET
SQL Backup query with where statement
SQL Backup query with where statement       SQL Backup query with where statement ... The Tutorial show you a example from 'SQL Backup query with where
The DELETE Statement, SQL Tutorial
The DELETE Statement       The DELETE statement is used to delete rows from a table. database will update that is why deletion and insertion of data will be done.  Syntax    
PHP SQL Insert Statement
PHP SQL Insert Statement       PHP SQL Insert Statement show you the message when the records... The Tutorial illustrate an example from 'PHP SQL Insert Statement'. To understand
to write an SQL query using insert statement
to write an SQL query using insert statement  I need to write an sql query for the below using InSERT command.pls help. Insert 5-star ratings by James Cameron for all movies in the database. Leave the review date as NULL
SQL AND Statement
SQL AND Statement       The SQL AND operator is used to show you the filter records... with Example The Tutorial illustrates an example from SQL AND Statement
SQL Backup query with where statement
SQL Backup query with where statement       SQL Backup query with where statement ... The Tutorial show you a example from 'SQL Backup query with where
JDBC Batch Example With SQL Insert Statement
JDBC Batch Example With SQL Insert Statement: In this tutorial, we are discuss about insert SQL statement with the jdbc batch. First of all, we... SQL insert statement for save data in the datasource and add
JDBC Batch Example With SQL Update Statement
JDBC Batch Example With SQL Update Statement: In this tutorial, we are discuss about update SQL statement with the jdbc batch. Now we will create a java...;); Now we will create Statement object by using createStatement() method
The INSERT INTO Statement, SQL Tutorial
values then we should use the following SQL statement...The INSERT INTO Statement       The INSERT INTO statement is used to insert or add a record
JDBC Batch Example With SQL Select Statement
JDBC Batch Example With SQL Select Statement: In this example, we are discuss about SQL select statement with JDBC batch process. We will create SQL select  statement and execute it in a result set and after that fetch
SQL SELECT DISTINCT Statement
SQL SELECT DISTINCT Statement   ... clause with the select statement. The SQL Distinct clause is used with the Select... 'Stu_Table'. SQL statement to create table: create
Use HANDLER Statement in Cursors
open the cur1 which built a result set. The repeat statement in SQL include... Use HANDLER Statement in Cursors       Use HANDLER Statement in Cursor is used to define
PHP SQL IF Statement
PHP SQL IF Statement       This example illustrates how to use the 'if' statement in php when... the if statement, so only one data will display here as shown in the output.  
PHP SQL IF Statement
PHP SQL IF Statement  This example illustrates how to use the 'if' statement when accessing the data from mysql database table in php. .... Here we are using the if statement, so only one data will display here as shown
for statement
for statement  for(int i=0;i<5;i++); { system.out.println("The value of i is :"+i); } if i end for statement what will be the output   got the answer.. it displays only the last iteration that is "The value of i
JDBC Prepared Statement Example
it is created ,it is represented as SQL statement. The advantage of this statement  is SQL statement sent to the DBMS,in which it is compiled... JDBC Prepared Statement Example     
SQL GROUP BY Example
SQL GROUP BY Example In this section we will discuss about the group by statement in SQL. In this tutorial we will use MySQL for using the SQL statements... be used with or without the SQL aggregate functions written with the SELECT
Regular expression
Regular expression  how i write a regular expression for a pattern which present in between
SQL Mode
SQL Mode       SQL... expression. When there are no duplicate values in the records, the mode returns NA...;       mysql> SET sql_mode = ''; Query OK
Regular expression
Regular expression  I have the regular expression : var x=/(^\d+$)/ which allows only numbers. It does not accept character, decimals. However it accepts zero. I want an expression that takes numbers(no decimals)except zero
SQL Create View
is defined  as a virtual table outcome as a result of an SQL statement. A view... is created, The insert into statement of SQL is used to insert the records or rows... view's SQL statement. The user write a queries view
Hibernate Expression
In this section we will discuss Hibernate Expression
JDBC Batch Example With SQL Delete Statement
JDBC Batch Example With SQL Delete Statement: Learn How to use delete MySql statement with JDBC Batch processing. First of all, we will create a java class...() as: connection.setAutoCommit(false); 3. Create SQL delete statement for save data
Prepared Statement Example
is used to make the SQL statement execution efficient. In Java, when we use... in implementation. Statement is used to execute the static SQL statement whereas, PreparedStatement corresponds a precompiled SQL statement. When we use

Ads