how to create a user in SQL, I am unable to do and still using "sys as dba" for connections and the password i created when installed. Also I create a schema named USER using DBeaver in oracle. but when I am creating a table in java with
final String newTable = "CREATE TABLE USER.Employee"+
"(empId NUMBER NOT NULL,"+
"name varchar2(10) DEFAULT NULL,"+
"PRIMARY KEY (empId))";
its not working. its giving error- java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:195)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1036)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336)
at oracle.jdbc.driver.OracleStatement.executeUpdateInternal(OracleStatement.java:1845)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:1810)
at oracle.jdbc.driver.OracleStatementWrapper.executeUpdate(OracleStatementWrapper.java:294)
at com.sumit.batch.BatchEntry.main(BatchEntry.java:19)
please help..:)
Use PreparedStatement to create a table.
PreparedStatement pstmt = conn.prepareStatement("create table survey (id int, name VARCHAR(30) );");
pstmt.executeUpdate();
SQL Error [942] [42000]: ORA-00942: table or view does not exist java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
Configuring Oracle
Ensure that you have a database instance available for Bamboo (either create a new one or use an existing one).
Within that database instance, create a user which Bamboo will connect as (eg bamboo-user). (tick) Remember this database user name, as it will be used to configure Bamboo's connection to this database. (info) When you create a user in Oracle, Oracle will create a 'schema' automatically.
create user bamboo-user identified by password;
Ensure that the user has the following permissions:
grant connect, resource, create table to bamboo-user;
For more, you can go through this 2 links:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.