How to create a database using a SQL statement? Please help.

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.25:1521:mydb","system","12345678");
but mydb database does not exist.
I want to make a connection to oracle server without database name.
How can I do?

Colleauge, what is the purpose of making a connection to a non-existent database.
connections are made to the database to retrieve some data or put some data.
for which the database should exists.
so please create the mydb database first using Database Configuration Assistant (DBCA) which is much easier as it is GUI based rather than doing it with sql scripts.

Similar Messages

  • How to create a counter using Oracle SQL Developer?

    Is there any way to create a counter using Oracle SQL Developer to create the below scenario. Meaning it will recorded down the name of user and ID and time and the date they login.
    Library portal home statistics shows how many users (outside and within the campus) visit the library portal.
    Page Access statistics is recorded on an hourly basis. Users may select the statistics by
    yearly (statistics displayed by all months in the selected year)
    monthly (statistics displayed by all days in the selected month)
    daily (statistics displayed by all hours in the selected day)

    I'm giving here one basic post - hope this will solve your problem --
    SQL>
    SQL>
    SQL> create table audit_info
      2   (
      3     usr        varchar2(50),
      4     log_time   timestamp(6)
      5    );
    Table created.
    SQL>
    SQL>
    SQL>  create table err_log
      2     (
      3       log_cd      varchar2(20),
      4       log_desc    varchar2(500)
      5     );
    Table created.
    SQL>
    SQL>
    SQL>   create or replace procedure ins_err(errcd   in  varchar2,
      2                                        errnm   in  varchar2)
      3    is
      4      pragma autonomous_transaction;
      5    begin
      6      insert into err_log values(errcd,errnm);
      7      commit;
      8    end;
      9  /
    Procedure created.
    SQL>
    SQL>
    SQL>   create or replace procedure ins_aud(ud   in varchar2,
      2                                        unm  in varchar2)
      3    is
      4      pragma autonomous_transaction;
      5    begin
      6      insert into audit_info values(ud,unm);
      7      commit;
      8    exception
      9      when others then
    10        ins_err(sqlcode,sqlerrm);
    11    end;
    12  /
    Procedure created.
    SQL>
    SQL>
    SQL>
    SQL> create or replace trigger log_odsuser1
      2   after logon on odsuser1.schema
      3   begin
      4     ins_aud('ODSUSER1',sysdate);
      5   exception
      6     when others then
      7       ins_err(sqlcode,sqlerrm);
      8   end;
      9  /
    Trigger created.
    SQL>
    SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jun 12 12:21:09 2007
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    SQL>
    SQL>
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL>
    SQL> select * from audit_info;
    USR
    LOG_TIME
    ODSUSER1
    12-JUN-07 12.00.00.00000000 AMHope this will solve your purpose.
    Regards.
    Satyaki De.

  • I don't have wifi connection.I need to update my software to ios 8.0.2.How can I download it using cellular data?Please help

    I don't have wifi connection.I need to update my software to ios 8.0.2 using cellular data.How can I download using cellular data?.Please help.

    There are often places to go which have free WiFi ie coffee shops, shopping malls, fast-food places.
    You can connect the phone to your computer & download/update via iTunes if you have one.

  • How to create a database using SQL Developer

    Hallo,
    I am a user of OpenSUSE 11.4 and have Oracle database install in my system. I was reading this page regarding on creating a database. But I don't know how to launch DBCA in my system. May I know how can I launch DBCA in OpenSUSE 11.4?
    THanks @!

    user4994079 wrote:
    Hallo,
    I am a user of OpenSUSE 11.4 and have Oracle database install in my system. I was reading this page regarding on creating a database. But I don't know how to launch DBCA in my system. May I know how can I launch DBCA in OpenSUSE 11.4?
    THanks @!You'd launch it in exactly the manner in which your cited reference says:
    --- begin quote ---
    by entering the following on the UNIX command line:
    dbca
    --- end quote ---
    Of course the documentation assumes you've completed the first five minutes of Computer Admin 101 and so realize you should include the directory that has the executabale file. In this case, your PATH should include $ORACLE_HOME/bin
    So, what have you tried? What result did you get?
    And why are you citing a reference for a old, unsupported version of Oracle?
    And why the reference to SQL Developer in your subject line? This has nothing to do with SQL Developer.
    Edited by: EdStevens on Apr 16, 2011 9:15 PM

  • HOW TO START MAKING DATABASE USING ORACLE SQL PLUS in 10g?

    how will i create database using sql plus?
    does the code of sql applicable to it..?
    do i have to use the "create db <database name>", use and " create table also,.."
    pls help me..
    thanks

    At dos prompt :
    C:\>set ORACLE_SID=<your SID>
    C:\>sqlplus / as sysdba
    you get connected as sys user. Don't use this connection to create your own objects, create users instead.... but it would be useful to read some documentation, for example Starting SQL*Plus and manuals mentioned there.

  • How to create a database using Java?

    Hi there..
    I'm a student who is currently studying IT and was asked to do a project based on database but create using Java.. since i'm a beginner..i was wondering whether is it possible to do that?
    and if it is possible.. can you kindly show me a sample of code on how to start the project...
    thank you
    yours sincerely,
    Shafini

    While duffymo is correct in regard to most major database products, it's my understanding (warning! wild-ass guess coming) that the Hypersonic DB is more "application-centric" and the dynamic creation of databases is part of its design. It's pure Java database software, and therefore is not appropriate for all database projects, in particular those that require extremely high-performance.
    See http://hsqldb.org/
    I've not used it yet (but soon though), and I can't really advise anyone about it.
    However, I'm wondering if you phrased you question in a way that is confusing us. To most of us in casual conversation, a "database" is both (1) a large organized collection of data and (2) the software that is used to organize and access it. However, the phrase "create a database" usually means creating a (1) database (a collection of data) using an already created (2) database software, such as Oracle, MySQL, DB2, HSQDB, etc., etc. If you'r question is, how do a create some new database software using Java, the answer is that this is a very very big and hard thing to do for the general case and probably not something you want to be doing.

  • How to create a database using LabView?

    Hy
    I have to do a project in which i have to create a database with the situation of the students (name,age...) using ONLY LabView.I need to enter tha students using labview, to save the database using labview.... I have to figure it out how to do this, but .... no idea. Also i have to make a search in that database. If you can help me, i apreciate that or if you know a link on the web about something like this
    Thanks,
    Lorant

    Labview configuration files are very easy to use and can hold any type of information you wish.  There are functions in the File palette ready to use for configuration files.  A configuration file is similar to a registry entry.  You can have sections and keys.  So you can create a section called "Data1" and keys called "Name", "Age", etc.  Create the same for a new section called "Data2", and so on.  The functions are useful for writing the config file and reading from the file.  To read a certain piece of data, just supply the section name and the key name.  So you could ask for section "Data20", key "Name", and you would get the 20th name in the database (config file).  This way you don't have to write code to search the database for certain items, the functions do it for you and they are already written.  Look into config files.  They are very easy to use, very useful, and very underused even by the most experienced LV programmer.
    - tbob
    Inventor of the WORM Global

  • HOW DO I GET TO USE MY E FAX PLEASE HELP/PHOTOSMART H.P E STATION C510 SERIES

    I NEED HELP, SOMEONE OUT THERE PLEASE HELP ME . I NEED TO GET THIS E FAX STARTED AND I ASK FOR HELP FROM H.P. SUPPORT AND THEY WERE NOT ABLE TO GET ME IN THE RIGHT DIRECTION , I MIGHT TAKE THIS PRINTER BACK AND RETURN IT FOR I NEED TO FAX BUT TO NO AVAIL! PLEASE HELP.  MARY1PEREZ

    I hope you are doing well and sorry to learn that you are having this issue. 
    Take a look to this Article should guide through the proccess of setting efax.
    Important : To send or receive faxes using eFax, your HP product must be connected to the Internet on a wireless network, and you must enable Web Services. If you use a USB cable to connect your HP product to your computer, you also need to connect it wirelessly to use eFax.
    Hope it puts you in the right path and your printer working;
    RobertoR
    You can say THANKS by clicking the KUDOS STAR. If my suggestion resolves your issue Mark as a "SOLUTION" this way others can benefit Thanks in Advance!

  • SQL STATEMENT , PLEASE HELP

    Hi,
    I want some help in writing a SQL Query .Its besically a hierarchical query. Let me lay down the table structure first to explain my requirements better.
    PORP_TABLE(NODE_LEVEL int, WBS_ID int, WBS_NUMBER varchar(60), LFT int,RGT int)
    SELECT NODE_LEVEL, WBS_ID, LFT,RGT FROM PROPOSAL_WBS PW WHERE PROPOSAL_REV_ID = 7000
    (SAMPLE DATA)
    NODE WBS
    LEVEL WBS_ID NUMBER LFT RGT
    0 7055 ROOT 1 24
    1 7056 1 2 5
    1 7088 2 6 9
    2 7057 1.1 3 4
    2 7089 2.1 7 8
    2 7091 3.1 11 14
    2 7103 3.2 15 16
    2 7105 4.1 19 20
    1 7090 3 10 17
    3 7092 3.1.1 12 13
    1 7104 4 18 23
    2 7106 4.2 21 22
    ALLOCATION_DETAIL( WBS_ID int, COST_ID int, PERIOD Date, AMOUNT Float)
    sample data
    WBS_ID , COST_ID , PERIOD , AMOUNT
    7057 100 01-jan-2005 5000
    7057 100 01-feb-2005 2000
    7057 100 01-mar-2005 1000
    7057 100 01-apr-2005 6000
    7057 100 01-may-2005 3000
    7057 100 01-jun-2005 45000
    7106 100 01-mar-2005 8000
    7106 100 01-apr-2005 7000
    7106 100 01-may-2005 9000
    Now the PORP_TABLE has got the parents and childs. Only the leaf nodes in the hierarchy has the values stored in the ALLOCATION_DETAIL table. Now here is the scenario
    In the example 7055 is the root WBS . The Leaf WBS are the one with max extension in the wbs number ( in this case it is 1.1, 2.1, 3.1.1, 3.2, 4.1 and 4.2)
    Now the Starting period for each leaf node in the ALLOCATION_TABLE could be differrent . What that means is WBS 1.1 could start in Jan -2003 and WBS 3.1 Could be Jul-2005 . So the ending perios are also differrent for differrent WBS . Some can span 2 years some can 5 years.
    So how to write a query so it retrieves the value for all the Wbs starting from the MIN ( PERIOD ) upto the MAX(PERIOD), and it should roll up also. Now there is No connect by Prior or any analytic functions available for this . THIS NEEDS TO BE DONE ONLY THROUGH TRADITIONAL SQL STATEMENT . And NO DB FUNCTIONS CAN BE USED .
    Now if the WBS is a parent node then it should have the sum of all its child nodes for the COST category.
    SO THE RESULT SET SHOULD BRING LIKE THIS
    WBS_NUMBER, PERIOD_NUMER, COST_CATEGORY , AMOUNT
    ROOT
    1
    1.1
    2
    2.1
    3
    3.1
    3.1.1
    3.2
    4
    4.1
    4.2
    ......

    Thanks for all your thoughtfull replies and feedbacks. Yes it is in Sybase platform . Though I have been woking all along in Oracle , Unfortunately this one is in Sybase, and no the customer cant and wont move to Oracle. So I have to work with it . And if you want to see the table structure . Here are they :
    CREATE TABLE PROPOSAL_WBS (
    BURDEN_CENTER_ID      numeric(18,0) NULL,
    START_DATE      datetime NULL,
    END_DATE      datetime NULL,
    WBS_ID      int NOT NULL,
    MODIFIED_DATE      datetime NULL,
    CREATED_DATE      datetime NULL,
    MODIFIED_BY      varchar(127) NULL,
    CREATED_BY      varchar(127) NULL,
    FEE_PERCENT      float NULL,
    PROPOSAL_REV_ID      int NOT NULL,
    PARENT_WBS_ID      int NULL,
    NAME      varchar(127) NULL,
    COMMENT      varchar(255) NULL,
    TARGET_COST      float NULL,
    MONTHS_REMAINING      int NULL,
    DEFAULT_STAFF_FTE      float NULL,
    ANNUAL_GRA_SALARY      float NULL,
    NUMBER_OF_GRA      int NULL,
    MANAGEMENT_ADJUSTMENT_TOTAL     float NULL,
    MA_UNALLOCATED_FUNDS      float NULL,
    FEE_TOTAL      float NULL,
    FEE_UNALLOCATED_FUNDS      float NULL,
    TRAVEL_COMMENTS      varchar(255) NULL,
    ODC_COMMENTS      varchar(255) NULL,
    SORT_ORDER      int NULL,
    LFT      int NULL,
    RGT      int NULL,
    NODE_LEVEL      int NULL,
    WBS_NUMBER      varchar(50) NOT NULL,
    TOTAL_COST      float NULL,
    TOTAL_COST_PLUS_FEE      float NULL,
    PER_MILE_COST      float NULL,
    PER_DIEM      float NULL,
    TAX_RATE      float NULL,
    RENTAL_CAR_PER_DAY_COST      float NULL,
    TAXI_PER_TRIP_COST      float NULL,
    CONSTRAINT PK_PROPOSAL_WBS PRIMARY KEY(WBS_ID)
    CREATE TABLE PROPOSAL_WBS_ALLOC_DETAIL (
    WBS_ID      int NOT NULL,
    OBJECT_CODE_ID      numeric(18,0) NOT NULL,
    PERIOD_NUMBER      int NOT NULL,
    ALLOCATION_AMOUNT     float NULL,
    PERIOD_YEAR      datetime NULL,
    CONSTRAINT PK_PROPOSAL_WBS_AD PRIMARY KEY(WBS_ID,OBJECT_CODE_ID,PERIOD_NUMBER)
    CREATE TABLE WBS_PERIOD (
    PERIOD_NUMBER     int NOT NULL
    CREATE VIEW WBS_COST_CAT AS
    SELECT PROPOSAL_WBS.PROPOSAL_REV_ID,
    PROPOSAL_WBS.WBS_ID,
    PROPOSAL_WBS.NAME, PROPOSAL_WBS.SORT_ORDER,
    PROPOSAL_WBS.NODE_LEVEL, PROPOSAL_WBS.WBS_NUMBER,
    CODES.CODE_ID COST_CATEGORY, CODES.CODE_NAME COST_CAT_NAME
    FROM PROPOSAL_WBS, CODES
    CREATE TABLE CODES (
    CODE_ID      numeric(18,0) NOT NULL,
    CODE_VALUE      varchar(254) NULL,
    CODE_NAME      varchar(254) NULL,
    CODE_TYPE      numeric(18,0) NULL,
    CODE_PARENT_ID     numeric(18,0) NULL,
    CONSTRAINT PK_CODE_ID PRIMARY KEY(CODE_ID)
    So let me explain little bit more . The WBSs are categorized into two differrent types. One as INPUT and the second one as NON INPUT. Now assme the the WBS in a tree structure . So only the LEAF WBSs will have the AMOUNT and they are the INPUT WBSs and all non leaf WBSs are NON INPUT. Now lets say there are 5 LEAF WBSs. Each LEAF WBS will have differrent start period ex: WBS 1.1 starts in January 2003 and goes for 48 periods . WBS 2.1 starts in November 2003 and goes for 35 periods . WBS 3.1 starts in March 2004 and goes for 52 periods. and so on .
    Now as there is no Allocation Amount entry for all other WBSs except the LEAF WBSs. So how do I get the roll up . For example if you imagine the parent of WBS 1.1 is WBS 1 , and the parent of WBS 2.1 is WBS 2 and the Parent of WBS 3.1 is WBS 3 , and the parent for WBS 1, WBS 2, WBS 3 is "ROOT WBS". As I said there is no entry for WBS 1, WBS 2 , WBS 3 and the "ROOT WBS". So how do I have a roll up of the Leaf WBS data for their parent WBSs.
    Now if u think of the data in a matrix report, the WBSs and the COST CATEGORY will be the row values, the Period Numbers will the column values and the Allocation Amount will be the cross values. so lets say the WBS 1 has got two leaf nodes, WBS 1.1 and WBS 1.2 then WBS 1 will have the summed amount for each period starting the minumum period of the two of its leaf nodes and for all the cost categories of both the leaf nodes. and the "ROOT WBS" will have all the cost categories of al the Leaf nodes . for all the periods , period wise.

  • How to create a Folder using a SQL Query?

    Hi
    How can I create a Folder (eg. C:\MyNewFolder) using SQL Query?

    Hi,
    I added some code in order to get the result from the xp_cmdshell command
    This returns null if successfull, if an error occurs returns the error message. May be useful instead of getting an sql error
    Code Snippet
    declare @cmdpath nvarchar(60), @Location nvarchar(100), @message nvarchar(max)
    set @Location = N'C:\Temp\Temp5'
    set @cmdpath = 'MD '+ @Location
    Create table #result
    result nvarchar(255)
    insert into #result (result) exec master.dbo.xp_cmdshell @cmdpath
    select @message = ISNULL(@message + ' - ','') + result from #result where result is not null
    select @message
    drop table #result
    Eralper
    http://www.kodyaz.com

  • How to create tables for using in SQL/php website

    Sorry for asking basic question because I 'm knew.
    i was building a dw site for listing multiple products. i was following DW, the Missing Manual book tutorials. The tutorial offers downloadable data tabels in a folder with .sql extension. I just cannot find anywhere an instruction as how the .sql folder is created.
    Second question: if it can be created in Access 2007, please tell me how.
    thank you sooo much.

    Hi Walt,
    Thank you so much for spending the time trying to answer me.
    you are right, it is a .sql file, not a folder. However, once it is imported into MySQL server, it spits out 4 tables. Please see the following tutorial steps:
    "4. in phpMyAdmin's top navigation bar, click the Import button.
    Doing so takes you to a page that lets you type in an SQL query or load a test file that has SQL commands in it. You'll do the latter-load a text file that contains all the SQL necessary to create the tables and data for the database.
    5. Click the Browse button in XAMPP (application software for SQL server), In the File Upload window that appears, navigate to and select the file cosmofarmer.sql in the php_dynamic folder you downloaded with the tutorial files.
    6. Click the Go button.
    The MySQL server slurps down the SQL file, and executes the instructions found within it. The results? Four new talbes are created (see the list of talbles that just appeared on the left side of the phpMyAdmin window) and a bunch of data is added to them. "
    The book I am reading explains everything but how the cosmofarmer.sql file was made.

  • How to create a database using Cloudscape provided by Weblogic

    Hi,
    I am new to EJB and i am trying to run the sample Entity bean given in the book "Enterprise
    Java Beans" by Richard Monson-Haefel.In the 4th chapter he has given a example Cabin
    Entity bean.
    My problem is i am not able to execute Cloudscape to create a table called CABIN.
    I first set the environment by giving command \weblogic\setEnv (i have done the CLASSPATH
    setting for cloudscape in this).When i give the command >java COM.cloudscape.tools.cview
    , I get a error "Exception in thread Main".
    Can anyone help me on this ?
    Thanx in advance.
    Sanjay.

    Labview configuration files are very easy to use and can hold any type of information you wish.  There are functions in the File palette ready to use for configuration files.  A configuration file is similar to a registry entry.  You can have sections and keys.  So you can create a section called "Data1" and keys called "Name", "Age", etc.  Create the same for a new section called "Data2", and so on.  The functions are useful for writing the config file and reading from the file.  To read a certain piece of data, just supply the section name and the key name.  So you could ask for section "Data20", key "Name", and you would get the 20th name in the database (config file).  This way you don't have to write code to search the database for certain items, the functions do it for you and they are already written.  Look into config files.  They are very easy to use, very useful, and very underused even by the most experienced LV programmer.
    - tbob
    Inventor of the WORM Global

  • How to create a database link to SQL Server from a RAC environment

    We have a 4 node RAC running 11.2.0.3 binaries on 64-bit linux.
    Grid owns the listener named listener.
    Oracle owns the database.

    Thanks all! But I tried to configure and I am getting
    TNS-01201: Listener cannot find executable /u01/app/oracle/product/11.2.0.3/dbhome_1/bin/InfoEdb10 for SID InfoEdb10
    Listener failed to start. See the error message(s) above...
    So! What I did was
    1. Configure the odbc from the OS (only one node) and create the DSN and its odbc files.  connectivity works from Operating Systems.
    2. Create the listener entry (under GRID) user.
    3. Create the remotedb.ora file under $ORACLE_HOME/hs/admin
    --- Here is listener.ora file
    LISTENER_NODE1_TG =
       (DESCRIPTION_LIST =
        (DESCRIPTION =
           (ADDRESS = (PROTOCOL = TCP)(HOST = devrac-a-01-vip.cssd.pitt.edu)(PORT = 1549)(IP = FIRST))
           (ADDRESS = (PROTOCOL = TCP)(HOST = devrac-a-01.cssd.pitt.edu)(PORT = 1549)(IP = FIRST))
    SID_LIST_LISTENER_NODE1_TG =
       (SID_LIST =
           (SID_DESC =
             (SID_NAME = InfoEdb10)
             (ORACLE_HOME = /u01/app/oracle/product/11.2.0.3/dbhome_1)
             (ENVS = "LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0.3/dbhome_1/lib")
             (PROGRAM = InfoEdb10)
    any  help is appreciated

  • How to creating pdf documents using c# and Adobe SDK

    I downloaded Adobe SDK and go through the samples given in sdk. But i couldn't find any sample code how to create PDF file using C# code.
    Please, help me with this.
    Thanks.

    For desktop-based solutions, look at the Adobe Acrobat SDK which enables development around Acrobat itself. Or if you wish a stand-alone solution (for either desktop or server), we offer the Adobe PDFLibrary, which is the same technology used by all of Adobe's applications.
    For the server, we have our LiveCycle products including LC Generator.
    Leonard

  • How to create updateable resultset using sql with "order by"

    Dear all,
    I'm using the Derby database to hold a table of stock prices. After the table is populated, I want to do some calculations and store the result in a column.
    I get the resultset using the following code
    Statement stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery(select history_id, value, days from history where ticker = '" + ticker + "' order by value_date"); {code} When I then try to update the "days" field, I get an SQLException telling me that the resultset is not updatable. However, if I remove the "order by" clause, I am able to update the data, but then my algorithm does not work as I need to traverse the data in a specific order. The quesion is: how do I create an updatable resultset using a sql-statement with an order by clause? Kind regards Karl Martin Lund                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    jschell wrote:
    Seems rather obvious to me that the exception specifically tells you that you can't do that.OP: I would guess it's because ORDER BY forces the database to read all the result rows into a temporary area, sort them, and then return them from this temporary area, as opposed to streaming the results. The extra step probably makes updateable result sets more difficult (or maybe not possible), so they opted not to do it.

Maybe you are looking for