java.sql.SQLException: ORA-00903: invalid table name
843842May 6 2008 — edited May 6 2008Hi everybody
I wrote a simple jdbc program and in compilation time iam not getting any error,but when i run my program it gives the error
"java.sql.SQLException: ORA-00903: invalid table name"
Actually my program is:
import javax.sql.*;
import java.sql.*;
import oracle.jdbc.pool.*;
import java.io.*;
import java.lang.reflect.*;
class d_test
{
public static void main(String args[])
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.101:1521:tiger","scott","scott");
Statement st=con.createStatement();
String sqlst1="create table emp13(eid number(9),ename varchar //(10),esal //number(8))";
st.executeUpdate(sqlst1);
String sqlst2="insert into table emp13 values(2,'malli1',85000)";
st.executeUpdate(sqlst2);
System.out.println("1 row inserted");
ResultSet rs=st.executeQuery("select * from emp13");
while(rs.next()){
System.out.println(rs.getString(1));
System.out.println(rs.getString(2));
System.out.println(rs.getString(3));
}
con.close();
}
catch (Exception e)
{
System.out.println(e);
}
}
}
and what's happening is when i run this program tha table was created in the database but the row was not inserted.
If i commented the 2 lines insert table values rows:
//String sqlst2="insert into table emp13 values(2,'malli1',85000)";
//st.executeUpdate(sqlst2);
Then it executes without any errors and creates the table with that name(given in the java program)but if i wrote these 2 lines code then at the run time the error was comming.
Iam not understanding what is happening.
and
My oracle version is :10.2.0
My java version is:jdk1.5
Can anybody suggest me plz
Thanks in advance
Edited by: javagrl on May 6, 2008 11:11 AM
Edited by: javagrl on May 6, 2008 11:28 AM