Questions regarding creating the database

Hi there,
From the previous posting, http://forum.java.sun.com/thread.jspa?threadID=640415&tstart=15 someone gave me the "formula" of connecting to the database:
java.sql.Connection  conn   =  java.sql.DriverManager.getConnection("jdbc:mysql://localhost/name_of_DB","user","password") Now just couple of questions regarding the formula :
1) Obviously, if I want the name of my DB, then I will have to create my DB. Can somebody please tell me the protocol of creating the DB? And where do I create this DB (i.e can I create it anywhere in my application)? Or is it that I have to create a new database using MySQL itself?
2) After creating a database, I would like to create multiple tables containing different datas. Is it possible to place the code creating these tables anywher in the application I want?
Your ideas or advice would be much appreciated. Thank you in advance.
Regards,
Young

1) Yes, you'll have to create the database using MySQL.
2) You sure can once you have the database created with the proper rights assigned to your user. You can put the code anywhere you want but you may want to put it somewhere where it only ran once like on install if you're doing a standalone app.

Similar Messages

  • EJB newbie -- do i need to create the database?

    I know this may seem an odd question but do i need to create a database and create all the tables with commands such as: CREATE TABLE (...)? or will the deployment descriptor do that for me?
    clarkie

    if u are using entity beans there is no need to create database.
    u can make use of create function of the entity beans...if u are using bmp u need to write explicitly the code(sql code) for creating the database
    if u r using cmp u dont need to explicitly write the code for creating the table
    regards
    shanu

  • Paraller Query Server Error while creating the database using DBCA on UNIX

    Hi All,
    I am try to create the database on UNIX PLATFORM database 11g R1.
    At the end of database creation using DBCA i got the errors:
    ORA-12801:error signaled in parallel query server P077
    ORA-00018: maximun number of sessions exceeded
    ORA-06512:at"SYS.UTL_RECOMP",line 760
    ORA-06512:at"SYS.UTL_RECOMP",line 773
    ORA-06512:at line 1
    Please suggest what can i do to remove this issue.
    Regards
    Girish Sharma

    user12104101 wrote:
    Hi All,
    I am try to create the database on UNIX PLATFORM database 11g R1.
    At the end of database creation using DBCA i got the errors:
    ORA-12801:error signaled in parallel query server P077
    ORA-00018: maximun number of sessions exceeded
    ORA-06512:at"SYS.UTL_RECOMP",line 760
    ORA-06512:at"SYS.UTL_RECOMP",line 773
    ORA-06512:at line 1
    Please suggest what can i do to remove this issue.
    Regards
    Girish SharmaIncrease value of SESSIONS(also processes) parameter as
    sqlplus "/as sysdba"
    show parameter sessions
    alter system set sessions =<new big value> scope=spfile;
    shutdown immediate;
    startup;

  • A question about CREATE PUBLIC DATABASE LINK and ORA-12154 error

    Dear all,
    I have a problem about public database link creation and I would appreciate if you could kindly give me a hand. I have the following connection parameters in my
    tnsnames.ora file:
    DGPAPROD.WORLD =
         (DESCRIPTION =
           (ADDRESS_LIST =
            (ADDRESS = (COMMUNITY=tcp.world)
              (PROTOCOL=TCP)(HOST=ORASR001)(PORT=1521)
           (CONNECT_DATA = (SID = DGPAPROD))
    ...Having the above mentioned parameters I can connect to this remote database directly in a SQL*Plus shell:
    $ sqlplus username/[email protected] works pretty well and the connection is established without any problem.
    Now, what I would like to do is to create a public database link to this remote database in order to avoid the user/connection switching for viewing the
    content of this database. I proceeded according to the syntax indicated in the Oracle online documentation:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_5005.htm#SQLRF01205
    Therefore I run the following in order to create a public database link
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING 'DGPAPROD.WORLD';Apparently there is no error and the link is created successfully. However it cannot resolve the remote host and whenever I run the following query
    (myenterprise is the name of a table in that remote database)
    SELECT *
    FROM myenterprise@SR001_dblink
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specifiedWhat causes this problem?
    Thanks in advance,
    Kind Regards,
    Dariyoosh

    spajdy wrote:
    You must have defined DGPAPROD.WORLD in tnsnames.oar on server where you DB is runnig.Hello there,
    Thanks a lot for this nice solution. In fact I had to add the connection parameters into the tnsnames.ora file of the server on which the link was created (not the tnsnames.ora of my oracle client stored on the localhost)
    After a bit googling I found another solution that allows to create the database link:
    CREATE PUBLIC DATABASE LINK SR001_dblink CONNECT TO user IDENTIFIED BY password USING '(DESCRIPTION =  (ADDRESS_LIST =  (ADDRESS = (COMMUNITY=tcp.world)
    (PROTOCOL=TCP)(HOST=ip_adresse)(PORT=1521)))(CONNECT_DATA = (SID = GPAPROD)))';Thanks a lot for your help!
    Kind Regards,
    Dariyoosh
    Edited by: dariyoosh on 18 nov. 2009 07:15

  • Entity Framework doesn't create the database in SQL Server Management 2012, instead it just creates in (localdb)\v11.0 How to fix it?

    Hi, I'm Begginer in Entity Framework. Then I'm having some problems.
    I created my entities and I give Save Changes. (Ok)
    Then, I Tried to Connect with the database through Server Explorer, if I use the instance of the SQL Server Management Studio 2012(PC-PAULO\INSTANCIAPJ) as Server Name, the database doesn't appears but, if I use the the instance (localdb)\v11.0 the dabase
    appears.
    How to change the save to the SQL Server Management Studio 2012, I don't know where this (localDB)\v11.0 saves.
    Help-me Thank you :D

    Hello PauloJos,
    The code should be ok and it is really strange that the database is only created into the local database in your machine. I am wondering if it is related with the machine environment, could you please have a try with below demo on your machine which works
    on my side and if it is possible, please have a try to run your application on other machines to see if it works:
    class Program
    static void Main(string[] args)
    #region https://social.msdn.microsoft.com/Forums/en-US/00eff3c4-2336-4807-9212-e6f2a6c8812e/entity-framework-doesnt-create-the-database-in-sql-server-management-2012-instead-it-just-creates?forum=adodotnetentityframework
    using (CFDbContext db = new CFDbContext())
    db.Database.CreateIfNotExists();
    #endregion
    public class CFDbContext : DbContext
    public CFDbContext() : base("UltraFoda3") { }
    public DbSet<TestOne> TestOnes { get; set; }
    public class TestOne
    public int ID { get; set; }
    public string Name { get; set; }
    Config file is similar:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </configSections>
    <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
    <parameters>
    <parameter value="v11.0" />
    </parameters>
    </defaultConnectionFactory>
    <providers>
    <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
    </entityFramework>
    <connectionStrings>
    <add name="UltraFoda3" connectionString="Data Source=YourServer;Initial Catalog=UltraFoda3;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
    </connectionStrings>
    </configuration>
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Which Is Better:Create The Database Manually Or As a Part Of  Your Code?

    hi everybody
    i just want to know people when you creating a JDBC Application
    and introduce the program to the user to deal with
    do you create the database through the database client like phpmyadmin for mysql
    or by using query in your program?if so when you use the query in your flow of code?
    or you restore an empty database backup file enclosed in the setup directory?
    i just want to know what is the best design way when creating the database on the end user machine?

    First_knight wrote:
    and how do you deal with user installing new operating system,or formatting the hard disk?
    you tell him to take backup of the database then restore it again,right?yes. How else is he going to preserve his data?
    sheesh...
    In real applications the database is just about always maintained separately from the application and contains a lot of logic and structures that you can't create using Hibernate, JPA, or whatever.
    It's also almost always a database that's been in existence for a long time, well before you ever were asked to write that Java application to talk to it.
    Autogeneration of tables is nice for rapid prototyping or for demo purposes where it allows you to install the application more easily, but that's about it.

  • Automating the installation process,creating the database, creating tables etc at the

    Hi,
    We have a requirement to install oracle 8.1.6 on solaris box. The whole installtion process should be automated. This process includes changing the kernel parameters, creating the oracle account as per the installation guide, configuring the logical volumes, creating the database as per OFA recommendations, creating tables etc. How can i do this with out any interaction from user. Can the Oracle software packager handle all these. Please Let me know ASAP.
    Thanks a bunch.

    Agata,
    The full retail should be white with a snow leopard on it but if you ordered from the on-line store you should be fine.  If it is having problems booting while holding the C key, try restarting the computer but this time hold the Option key.
    That will bring up a grey screen with the image of the Macintosh HD and an image of the CD.  Click the image of the CD and let it boot that way.
    Once booted, go through the install proceedure, choose language, etc.  Still using the same CD but let's see if for some reason it does not like the way it is being told to boot.
    Ralph

  • Error when I create the database

    I install the peopletools 8.49 for Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 and my operating system is Microsoft Windows Server 2003 Enterprise Edition Server Pack 1, v.1023.
    When I have installed the peopletools and the database, I modify the scripts in <PS_HOME>\scripts\nt and then change to <PS_HOME>\setup\PsMpDbInstall and double click setup.exe to run the database configuration wizard. All of the scripts are running correct, but the Data Mover is error. So I run the Data Mover manually. I create Data Mover import scripts and run it. It’s ok. Then I check the logs. I find the follow error:
    psadmin.log:
    ALTER TABLE SQLPLUS_PRODUCT_PROFILE ADD (LONG_VALUE LONG)
    ERROR at line 1:
    ORA-00942: table or view does not exist
    psdmtx.log:
    PSDMTX Error: signon
    verifyToolsVer.log:
    select TOOLSREL from PSSTATUS *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    sqlnet.log:
    Fatal NI connect error 12557, connecting to:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=cs.lab.net)(PORT=1521))(CONNECT_DATA=(SID=PSDB)(CID=(PROGRAM=C:\pt\bin\client\winx86\psdmtx.exe)(HOST=CS)(USER=Administrator))))
    VERSION INFORMATION:
         TNS for 32-bit Windows: Version 10.1.0.5.0 - Production
    Time: 19-MAY-2009 15:33:27
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12557
    TNS-12557: TNS:protocol adapter not loadable
    ns secondary err code: 12560
    nt main err code: 527
    TNS-00527: Protocol Adapter not loadable
    nt secondary err code: 0
    nt OS err code: 0
    Then I run version application engine program:
    C:\Documents and Settings\Administrator>C:\pt\bin\client\winx86\psae.exe -CD PSD
    B -CT ORACLE -CO SYSADM -CP SYSADM -R INSTALL -AI VERSION
    Message Set Number: 0
    Message Number: 0
    Message Reason: Invalid User ID and password for signon. (0,0)
    Error in sign on
    PSDB: database name
    SYSADM: peoplesoft owner id
    How can I resolve it?

    I create the database manually too. The errors are the same. I can login in data mover by SYSADM user or people user and the database and listener is running. However, I run version application engine program:
    C:\Documents and Settings\Administrator>C:\pt\bin\client\winx86\psae.exe -CD PSDB -CT ORACLE -CO SYSADM -CP SYSADM -R INSTALL -AI VERSION
    Message Set Number: 0
    Message Number: 0
    Message Reason: Invalid User ID and password for signon. (0,0)
    Error in sign on
    I change the user to try, it’s the same.
    Edited by: hzg on May 21, 2009 9:38 AM

  • Creating the database manually

    Hi,
    I have installed oracle database 10g in OEL5
    Now i need to create the database manually.
    How to create it,pls provide me some help

    Asif and Pavan are bad guys na? One has given doc link and another is saying for search in google.... Oaf now you have to read the dos/google and then create database command.... Really its very hard and time consuming task to learn oracle right? Can'nt they give you a direct copy paste steps, so that you may learn create database without going into docs?
    @Pavan and Asif,
    Just kidding with OP.... :)

  • Re-create the database

    I need to re-create the database to solve the system tablespace fragmentation.
    Could some body tell me how to do it?
    Should I first recreate the system tablespace first? and then create the tablespace one by one?
    Could somebody help me out?
    Thanks

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by cs:
    I need to re-create the database to solve the system tablespace fragmentation.
    Could some body tell me how to do it?
    Should I first recreate the system tablespace first? and then create the tablespace one by one?
    Could somebody help me out?
    Thanks<HR></BLOCKQUOTE>
    null

  • When create the database...

    When it create the database...
    It has a error ORA-03113...
    What can I do on it??

    Have a look at the topic posted by John Smiley "If you're having problems ...".
    This explains how to fix your woes...

  • You do not have enough free disk space to create the database

    Hello,
    When I try to create a database, I have this error message:
    You do not have enough free disk space to create the database. You need at least 1428480 kB on /opt/oracle, you have only 1179648 kB available, please alocate more free disk space.*
    When I run *# df -h* I have:
    /dev/mapper/VolGroup00-LogVol09
    5.7G 4.3G 1.2G 79% /opt/oracle
    and
    /dev/mapper/VolGroup00-LogVol10
    486G 542G 262G 68% /oracle_data
    and with vgdisplay I have:
    Alloc PE / Size 29772 / 930.38
    Free PE / Size 0 / 0
    My info is:
    Redhat Linux server release 5.8
    Oracle 11.2.0
    I do not know how to solve this.
    Please help me
    Thank you
    Frank

    976847 wrote:
    Please... like reading exercise, read again my last post and you will understand the information.
    1179648 kB available space is comparable with 1.2GB. Both are the available space.
    Thank you for your help.From the error you reported in your original post
    You do not have enough free disk space to create the database. You need at least <font color="red" size="4">1428480 kB</font> on <font color="red" size="4">/opt/oracle</font>, you have only <font color="red" size="4">1179648 kB</font> available, please alocate more free disk space.
    SQL> select 1179648 i_have, 1428480 oracle_needs,
      2         1179648 - 1428480 i_am_short
      3  from dual;
        I_HAVE ORACLE_NEEDS I_AM_SHORT
       1179648      1428480    -248832So, yes, both numbers report the available space in slightly different terms, but what you need to be concerned about is how much Oracle thinks you neeed to have, which is <font color="red" size="4">more</font> than you actually have on /opt/oracle.
    John

  • How to create the database schema from an existing TimesTen database ?

    Hello everybody,
    I'm a newbie to TimesTen database. Before doing complicated sql queries, I would like to obtain the database schema of TimesTen DB. I'm looking for a way to extract the schema of database (tables, keys, links between tables ...). When I was working on other db like postgreSQL, I was able to obtain the sql script of the database (for exemple, in order to re-create the database in an other server). Some software like PowerAMC was able to built the database model from these scripts.
    Do you know a way to obtain the same with TimesTen database ? Or with an other way ?
    Regards

    Hi,
    Take a look in the docs at ttSchema, this might do the trick.
    http://download.oracle.com/docs/cd/E13085_01/doc/timesten.1121/e13069/util.htm#autoId27
    Tim

  • How to change COMPATIBLE parameter while creating the database using DBCA

    I have installed 10.2.01.0 on centos 4.7
    Now i want to create database with COMAPTIBLE parameter 9.2.0.1
    I m trying to create database through DBCA, changed the initialization parameter COMAPTIBLE to 9.2.0.1.
    But gives me error
    ORA-19583: conversation termintated to error
    ORA-19870: error reading backup peice /opt/oracle/assistants/dbca/templates/Seed_Database.dfb
    ORA-00600: internal error code,arguments: [krbrckhr_compressed],[opt/oracle/assistants/dbca/templates/Seed_Database.dfb],[29],[30],[11420],[],[],[]
    ORA-06512: at "SYS.X$DBMS_BACKUP_RESTORE", line 5149
    ORA-06512: at line 16
    if i dont change the value of COMPATIBLE parameter then its running perfactly...
    But i have to set compatible parameter as 9.2.0.1....
    Can anybody tell me how to create database using 10g R2- 10.2.0.1.0 with compatible parameter 9.2.0.1

    Thank you for your response.
    I have tried that opting.
    After creating the database with COMAPTIBLE parameter 10.2.0.1.0 changed that parameter in init.ora file to 9.2.0 and start the database.
    But at that time getting
    ORA-00201: contorl file version 10.2.01.0 incompatible with ORACLE version 9.2.0.0
    ORA-00202: control file '/opt/oracle/oradata/ORCL/control01.ctl'

  • Questions regarding creating a physical standby database in 10gR2

    I'm setting up a physical standby database in a test environment using two windows 2003 servers. I was wondering if someone could answer a few questions I'm not too clear on. I've been thru the data guard manual and as much online information as i can find. I may have it working but wanted to post some things I'm not sure I did quite right.
    My tnsnames.ora files.
    On my primary database server:
    # tnsnames.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.
    PRIMARY =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SERVER1)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = PRIMARY.MYDOMAIN.com)
    STANDBY =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SERVER2)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = STANDBY.MYDOMAIN.com)
    On my physical standby database server:
    # tnsnames.ora Network Configuration File: f:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
    # Generated by Oracle configuration tools.
    STANDBY =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SERVER2)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = STANDBY.MYDOMAIN.com)
    PRIMARY =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = SERVER1)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = PRIMARY.MYDOMAIN.com)
    My Listener.ora files:
    On my primary database server:
    # listener.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = PRIMARY.MYDOMAIN.com)
    (ORACLE_HOME = f:\oracle\product\10.2.0\db_1)
    (SID_NAME = primary)
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = server1.mydomain.com)(PORT = 1521))
    On my physical standby database server:
    # listener.ora Network Configuration File: f:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = standby.mydomain.com)
    (ORACLE_HOME = f:\oracle\product\10.2.0\db_1)
    (SID_NAME = standby)
    LISTENER =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sever2.mydomain.com)(PORT = 1521))
    The next item I'm not sure about is after creating the control file for standby use.
    One the primary server I created it using:
    alter database create standby controlfile as 'sbcontrol01.ctl';
    I copied the primary database pfile I had created earlier to the standby server, renamed it and edited it.
    Initially I left the CONTROL_FILES= parameter pointing to the control01.ctl, control02.ctl and control03.ctl that I restored. But I was getting the error ORA-01665: control file is not a standby control file
    So I copied the sbcontrol01.ctl to sbcontrol02 and sbcontrol03.ctl and pointed the CONTROL_FILES= parameter at them.
    The error went away and the database came up. I still need to test it some more but wanted to see if what i did was correct or a fluke.
    Edited by: tjohnson on Mar 23, 2009 2:26 PM

    If in the primary I had control files named control01, control02 and control03 would I have been able to create a standby controlfile called control01.ctl or would I have had to name it something else like I did (sbcontrol01.ctl) and rename it to control01.ctl once I got it over to the standby database server?Suppose you have the primary database control file in C:\oracle\primary\control location with names control01.ctl and control02.ctl. Then also you can create a standby controlfile with control01.ctl and control02.ctl , but then the location to be created must be different.You can create it in C:\oracle\primary location and then transfer to the specified location mentioed in the pfile of the standby database and mount the standby database.
    But saying this i would suggested to keep the name different from control01.ctl as far as naming conventions are followed.It might confuse someoe whether its a primary database controlfe or a standby database controlfile.Usally primary database controlfile are named control01.ctl , coltrol02.ctl etc and for standby many do prefer keeping standby01.ctl, standby02.ctl.Thats just for for understanding.
    HTH
    Anand

Maybe you are looking for

  • Discoverer viewer -- export to pdf doesn't retain page settings.

    Hi, The report output in discoverer viewer is much different from that of plus. I am concerned abt the report headers. In discoverer plus, the headers are left, center and right aligned. But in viewer, every thing is aligned center. How can I get the

  • How do i buy Edge Reflow

    I already have Photoshop, through my CC account, and now looking into buying Edge Reflow. I just can't figure out how much it costs, or even how to purchase. All the links i follow, to purchase, take me to a plan overview, with products that i don't

  • Using XML schema in a Java application

    Hi, I need to parse and use an XML schema in an application, mainly for helping a user to build an XPATH. For that, I want to use the Schema classes bundled with Oracle's parser. Is there any documentation about that ? Or are the source code availabl

  • Creating a form with dynamic components

    I am rather new to LiveCycle, however I have made a few forms and distributed/collected them.  I would like to build a form where the user can fill in the fields and the info will be transposed to a different area of the form where the user can copy

  • HT201272 I bought a movie with my iphone and it can't download because it says there isn't enough storage.  What do I do?

    I purchased a movie on my iphone 4 and it says I don't have enough memory to download it.  What can I do?  capacity 6.3GB available is 2.4gb