This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes jdbc related Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "jdbc related" Watch "jdbc related" New topic

jdbc related

karthik mama
Ranch Hand

Joined: Aug 27, 2007
Posts: 34
Dear friends,
the problem is i am getting a run time exception when i run this class file InsertRecord.....THE SOURCE CODE IS BENEATH

C:\mypgm>java InsertRecord
Exception in thread "main" java.sql.SQLException: ORA-00984: column not allowed

at oracle.jdbc.driver.DatabaseError.throwSqlException(
at oracle.jdbc.driver.T4CTTIoer.processError(
at oracle.jdbc.driver.T4CTTIoer.processError(
at oracle.jdbc.driver.T4C8Oall.receive(
at oracle.jdbc.driver.T4CStatement.doOall8(
at oracle.jdbc.driver.T4CStatement.executeForRows(
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatem
at oracle.jdbc.driver.OracleStatement.executeUpdate(
at InsertRecord.main(


import java.sql.*;
public class InsertRecord
public static void main(String args[]) throws Exception
String url="jdbcracle:thin:@localhost";
Connection con=DriverManager.getConnection(url,"system","mama");
Statement st=con.createStatement();
String sql="insert into employee values (1002,ravi,6000)";
int row=st.executeUpdate(sql);
System.out.println(row+"row created");

David O'Meara

Joined: Mar 06, 2001
Posts: 13459

ravi is a string, it needs to be quoted with single quotes 'ravi'
I agree. Here's the link:
subject: jdbc related
jQuery in Action, 3rd edition