How to create an Oracle DATABASE through Java Programming Language.. ?

How to create an Oracle DATABASE through Java Programming Language.. ?

Oracle database administrators tend to be control freaks, especially in financial institutions where security is paramount.
In general, they will supply you with a database, but require you to supply all the DDL scripts to create tables, indexes, views etc.
So a certain amount of manual installation will always be required.
Typically you would supply the SQL scripts, and a detailled installation document too.
regards,
Owen

Similar Messages

  • How to create a oracle database by java code?

    how to create a oracle database by java code?
    please give some ways then that way's code

    I'm not sure what you mean with "database". Do you mean an Oracle instance or an Oracle user/schema (probably the latter, because that's the equivalent to a MS SQL Database).
    Creating an instance is definitely not possible from within Java. To create a new user this should be possible, as this can be done with SQL:
    GRANT connect,resource TO <newuser> IDENTIFIED BY <password>;
    I'm always cautious with questions like this. In 90% of the cases there is something wrong with the initial design. Creating a database shouldn't be something the application is doing.
    Thomas

  • Create new oracle database with JAVA

    Hi!
    I would appreciated it if you could help me to solve a problem that i have.
    I am trying to create a new oracle database by a JAVA 1.4.2 application. I am using the scripts that Oracle 10.g supplies during the creation of a new database from the server (Generate Database Creation Scripts) with the appropriate changes, generated by a java application. Unfortunately, i am unable to connect with the database and the listener. Is there any other way to create a new database by java and how can i solve my current problem with the oracle scripts?
    Thank you.

    A) To create a new schema, you need to be connected as a user that has create schema privilege, or as tyhe user who is to own the schema (remembering that the user has appropriate create privs, as seen in the GRANT command in the SQL Reference manual). Not an issue at all, I think, if you coordinate this with your DBA. Discussed very well in the Administrator's manual.
    B) Alternately, you could create a complete copy of the schema, including all desired objects (tables, views, etc.) in a separate database and simply export the user and schema. Then simply invoke the OS-based import command (imp) to load that entire thing into the target database.
    C) To create a new database, there are 3 simple steps ...
    1) create the appropriate initialization parameter file
    the init{sid}.ora file should be placed in the $ORACLE_HOME/dbs or %ORACLE_HOME%\database directory. (I recommend you do not attempt to create the spfile.) Of critical interest will be setting the block size information, the control file parameters, and using the appropriate memory management parameters, based on the version of the software you will be using to create the database instance.
    2) start an empty instance, pointing to the parameter file
    This will be an OS specific call, and will require that you have the correct OS environment set up as well as access to the ORACLE_HOME which will provide the software that you will invoke. In *nix you will need to call the sqlplus command with sysdba provs and in Windows you will need to call oradim to initialize this as a service.
    3) run the SQL create database command
    You might want to use the dbca to create a template of the create database command, or look in the SQL Reference manual for the variations on the command. Of critical interest will be initializing the redo logs as well as the system, sysaux (if needed), temp and undo tablespaces after which you can set up the regular tablespaces, users and schemas. I highly recommend that you have redundant copies of the control files on separate drives.
    You may want to review the online Concepts manual and the Adminstration Guide for some of the specifics to your needs, but I think I've covered the basics.
    Remember that ideally you will only have one database instantiated on any given server as the memory and CPU overhead of each instance is significant.
    Good luck.

  • How to create the oracle database for MDM

    Hello Friends,
    I am new to MDM technology. I have been asked to install MDM 5.5 on windows with oracle database.
    i have gone through the installation guides and master guide of MDM. But in the installation the procedure is not given to create the data base after oracle installation. i want to know do i need to create the database manually if yes then what should be the DBSID of the database and schema name etc.
    Please help.
    Thanks,
    Manoj

    Well, let's rock.
    <b>Oracle database creation</b>
    Use <b>Oracle Database Configuration Assistant</b> (Start -> Programs -> ...) to create a new database.
    The database naming (on Step 3) is up to you. I used MDM as for SID and MDM.<MYHOSTNAME>.<MYDOMAIN> as for the db name.
    Be sure you select UTF8 for the character set (on Step 12) - this requirement is mentioned in the SAP MDM Installation Guide.
    All other settings can go default.
    <b>Listener and TNS name configuration</b>
    The next step is to configure a listener and tns name for your database.
    Run the <b>Oracle Net Configuration Assistance</b> and select the "Listener configuration". Default settings on the wizard pages should suite your configuration.
    Click Finish.
    Run the <b>Oracle Net Configuration Assistance</b> again and select the "Local Service Name configuration". Add one. Choose the name of the database for the service name. It was MDM.<MYHOSTNAME>.<MYDOMAIN> for me.
    Ensure that you use name of the database that you've entered during the database creation.
    Everything else should go as suggested by default.
    Once you are at the Test stage of the wizard and get the "invalid login/password" message, clisk "Change login" and use SYSTEM user and the password you\ve entered during databae creation.
    After the test passes, you can connect to your Oracle database through the MDM Console.
    Please, let me know if you have any questions, I'll help.
    Thanks!

  • How to clear the DOS screen through java program

    how to clear the DOS screen through java program

    Just some Friday fun. Use the telnet program that comes with Windows and supports VT escape sequences.
    import java.io.*;
    import java.net.*;
    public class AutoTelnet {
         private static Socket s;
         public static void main(String[] args) throws Exception {
              Thread t = new Thread() {
                   @Override public void run() {
                        try {
                             s = new ServerSocket(5555).accept();
                        } catch (IOException ex) {
                             ex.printStackTrace();
              t.start();
              Process p = new ProcessBuilder("cmd", "/C", "start", "telnet", "127.0.0.1", "5555").redirectErrorStream(true).start();
              t.join();
              PrintStream ps = new PrintStream(s.getOutputStream());
              ps.println("Screen will be cleared in 5 seconds");
              ps.println("5");
              Thread.sleep(1000);
              ps.println("4");
              Thread.sleep(1000);
              ps.println("3");
              Thread.sleep(1000);
              ps.println("2");
              Thread.sleep(1000);
              ps.println("1");
              Thread.sleep(1000);
              ps.println("\u001b[2J");
              Thread.sleep(5000);
    }

  • Linking 2 oracle database through java

    can any one provide all the necessary information for linking 2 different oracle databases and retriving data for jsp web application.
    In one of my new web application i need to retrive data from 2 different oracle database's and show a report.
    At present ,the application is using linked tables for Ms-Access.
    I need to migrate the application from Access,StandAlone application to Oracle,Web application .

    db links

  • How to execute MS DOS command through Java program???

    Dear Sir,
    I want to run a MS-DOS command through my Java program. I have tried "Dir" command but no other command which takes command line args doesn't work at all. Please help.
    import java.io.*;
    class CommandPrompt
         public static void main(String[] args)
              try
                   File file = new File("C:/Temp/Java");
                   String[] cmd = {"command.com","/c","md folder"};
                   String[] envp = {""};
                   Process m;
                   String s = "";
                   m = Runtime.getRuntime().exec(cmd,null,file);
                   BufferedReader buf = new BufferedReader(new InputStreamReader(m.getInputStream()));
                   while ((s = buf.readLine())!=null)
                        System.out.println(s);
              catch (Exception ex)
                   System.out.println("Exception is "+ex);
                   ex.printStackTrace();

    1. This forum is for Swing-related issues only. This question should be posted to the "Java Programming" forum.
    2. Please enclose your sample code in code blocks; it's much easier to read that way. See here for how it's done: http://forum.java.sun.com/faq.jsp#messageformat
    3. Please provide more information, like what error messages you got and what OS you're running. For instance, if you're running WinXP, Win2k or NT4, your command processor should be "cmd.exe", not "command.com". When I made that change, your program worked for me.

  • Problem in storing  as Blob in Oracle Database from java Program

    Hi All,
    Am trying to store an image of size 80000bytes into Oracle database using setBytes() anndsetBinaryStream() method but I'm unable to store in database.can u please tell me what are the various methods to store the Blob data into the database?
    the ways i'm trying to store in Database :
    1) cstmt.setBinaryStream(2, new ByteArrayInputStream(ltImageArr
    .get(i)), ltImageArr.get(i).length);
    2) cstmt.setBytes(2, ltImageArr.get(i)) ;
    waiting for reply
    please help me out

    hi !
    it seems to be a bug under Oracle 10.2, for which i used this workaround :
    PreparedStatement pstmt =
    con.prepareStatement("INSERT INTO blobtable VALUES (?)");
    Blob blob = BLOB.createTemporary(con, true, BLOB.DURATION_SESSION);
    OutputStream out = blob.setBinaryStream(0);
    out.write(byteValues);
    pstmt.setBlob(1, blob);
    i hope it will help you
    bye !

  • How to create .exe file of the java program you create?

    This must be the qustions asked several time on the forums.So here it is again.
    This sounds absurd to some developers here cause you'll say just create jar file and distributre to usr but sometimes there is not possiblity of having runtime environment in windows computers.So if we can bundle the enviroment and the setup together then packing into exe and then distribute like most of commercial java application sounds better.But the problem is how to do that?
    Ok creating exe will increase the size but that doesn't matter,if there is any freeware tool to accomplish just that?

    Check this out:
    http://search.java.sun.com/search/java/index.jsp?qp=%2B
    orum%3A31&nh=10&qt=create+exe+file+program&col=javaforu
    s

  • How to create a packet by using java?

    Hi, i am currently working on a research and i have some problems here.
    1) how to create a packet by using java programming ?
    2) How can i set the packet's information (e.g: packet's length, size of its header, etc) by using java?
    I am currently in a midst of this now and i hope that someone is willing to correspond to my questions and help me out of it.
    Thank you!

    I wan to create a customize packet where the user can
    define the header size, the packet's length etc. in
    the program......Then you get to write it to the connection yourself. Look at the OutputStream classes to see how to write low level output to a connection.

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

  • How to Create A new Database in the oracle 10g XE

    i have oracle 10g XE i tried to create a new database but its giveing me error when i execute the sql command that is create database testDatabase how to create a new database in oracle 10g XE

    Hi there 785434,
    (This is a generic SQL question relating to Database Triggers, please post future questions of this type into the relevant forum area.)
    Moderator, please move this if able
    I use Before Update and Before Delete Triggers to record a 'snapshot' of the row being changed in my applications.
    Example:
    CREATE TABLE TEST
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE
    LOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE TABLE TEST_HISTORY
    DATA VARCHAR2(64 CHAR),
    CREATING_USERID VARCHAR2(20 CHAR) DEFAULT user NOT NULL,
    CREATED_DATE DATE NOT NULL,
    CHANGED_BY_USERID VARCHAR2(20 CHAR),
    CHANGED_DATE DATE,
    CHANGE_DESCRIPTION
    NOLOGGING
    STORAGE
    (MAXEXTENTS UNLIMITED);
    CREATE OR REPLACE TRIGGER TRG_BU_TEST
    BEFORE UPDATE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'UPDATE');
    END;
    CREATE OR REPLACE TRIGGER TRG_BD_TEST
    BEFORE DELETE ON TEST FOR EACH ROW
    BEGIN
    INSERT /*+ append */ INTO TEST_HISTORY
    (DATA, CREATING_USERID, CREATED_DATE, CHANGED_BY_USERID, CHANGED_DATE, CHANGE_DESCRIPTION)
    VALUES
    (:old.DATA, :old.CREATING_USERID, :old.CREATED_DATE, USER, SYSDATE, 'DELETE');
    END;
    Using triggers like this will record who made an update or delete to the database and record the row before it was changed.
    Note that this method might not be suitable for very high transaction rates.
    You will need to 'clear' these history tables as part of routine maintenance.
    Hope that this Helps.
    Ronald.

  • How to connect oracle database with JAVA

    how to connect oracle database with JAVA....
    using j2sdk and Jcreator . which connector to use .. what are the code for that ..

    PLEASE .... Ask in an Oracle Java forum.
    And read the documentaiton. There is a whole document devoted to doing that. http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm has examples.
    PLEASE ... do not ask product questions in a forum which clearly has a title saying it is devoted to assisting with download problems.

  • How to connect Oracle database  through Microsoft ODBC?

    My ODBC Configuration:
    DSN name is :db
    Username : india
    Server :db.world
    Now, i am trying to connect with oracle database through SQL*plus or TOAD.
    But, it is giving the following error.
    ORA-03121: no interface driver connected - function not performed
    Database version : 9.2.0.1.0
    Operating System : Microsoft Windows XP
    ODBC Version : 2.575.1117.00
    I am trying to connect with the database like this:
    Username : india
    Password : india
    Database : ODBC:db
    Can i connect like this otherwise whether i need install any other supporting driver?

    Now, i am trying to connect with oracle database
    through SQL*plus or TOAD.
    But, it is giving the following error.
    ORA-03121: no interface driver connected -
    function not performed
    I am trying to connect with the database like this:
    Username : india
    Password : india
    Database : ODBC:db
    As already stated, you can not use the DSN in SQL*Plus (nor TOAD, afaik)!
    I can reproduce the error message with the following:
    C:\>sqlplus a/b@ODBC:c
    SQL*Plus: Release 11.1.0.6.0 - Production on Mon Aug 4 21:34:58 2008
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    ERROR:
    ORA-03121: no interface driver connected - function not performedLooking up the message, it says:
    Cause: A SQL*Net version 1 prefix was erroneously used in the connect string
    Looks like this has nothing to do with your DSN - it is more a matter of not using a proper connection string.
    If 'Test Connection' works then you should probably proceed to work with Crystal Reports, using the DSN in question.
    However, you should note that the old MS ODBC driver for Oracle was designed for OCI 7 (and for databases 7.x-8.x) and is now considered obsolete by both MS and Oracle.
    Deprecated MDAC components and MS KB Article 244661.
    Use the Oracle ODBC driver included with a supported Client version instead.
    Edit:
    Clarifying and adding references.
    Message was edited by:
    orafad

  • How to connect to  Oracle database from webdynprojava application

    Hi
    How to connect to  Oracle database from webdynprojava application. where can we provide the code to connect to database.?
    Thank You.

    Hi,
    You need to create  Java Bean model. The bean is a typical java bean with default constructor, getter and setter. You can have additional methods for query etc. The attributes in the class will be your model node and attributes.
    However you need to configure the connection and create JNDI using visual administrator before writing the code.
    You can also consider writing Session EJB with oracle and using them in WD.
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/dcaa4f05535591e10000000a1553f7/frameset.htm
    Srini

Maybe you are looking for

  • Dell Monitor P2415Q

    I have a P2415Q monitor with rMBP 13", Mid 2014, OS 10.10.2, Intel Iris and a mDP/DP cable. Any resolution above 1920x1080 is marked as "(low resolution)" and looks that way. It makes no difference if I don't use MST or do. When I use MST, it only wo

  • Oracle Form will not load in browser

    Setup; Oracle 9.0.1.4.0 Database Oracle 9.0.4.0.19 Forms OS XP SP2 This is for testing so this is all local, no application server in use I have setup a very simple form using only one canvas with two fields. Login to Forms Dev->Start OC4J->Connect t

  • ZBFW Intra zone traffic not working

    I am having an issue on one of our 2811 routers where I can't get traffic between interfaces within the same zone to flow. I know this should happen by default and that's why it is so confusing. One of the interfaces is fastethernet0/0.1 which is int

  • Did anyone successfully install 7.8.2.14 and configure BI Publisher for 7.8

    Hi, I am installing 7.8.2.14 to gain BIP support but I am running into some issues. This is what I have done so far: * installed 7.8.2.14 and followed steps for ACR483 (BIP Integration) * installed QF0E02 (Actuate and BIP co-existence) * installed QF

  • 2.0 Hub, or not 2.0 Hub?

    Hello folks... Been a BT Broadband user for years and have happily used my creaking Origo adsl modem and trio of Linksys B/G wireless routers to distribute broadband around the house - and getting line speeds of around 6.5/.365 which is all groovy. e