How to create database from scratch using user input
what I am trying to do is to create database via my java code (using hibernate and my sql) and based on user input.
The details like the name of table.... or the number of columns in it are all supposed to be determined from user input (only the first time).
On subsequent run the program should remember the previously created database and hence work with it.
Can somebody help me through this?
Suppose I did create it using firing queries from my program then the next problem is how my program would start up next time......?????
Anuvrat wrote:
what I am trying to do is to create database via my java code (using hibernate and my sql) and based on user input.
The details like the name of table.... or the number of columns in it are all supposed to be determined from user input (only the first time).
On subsequent run the program should remember the previously created database and hence work with it.
Can somebody help me through this?Presumably because you want to (fun) rather than because you need to (job or project.)
If the second then don't do it.
>
Suppose I did create it using firing queries from my program then the next problem is how my program would start up next time......?????You would start by learning about DDL which is the common name for the languages, which vary by database, used to create the entities that represent the structure of a database. Until you figure out the syntax of that you can't do anything in java.
Similar Messages
-
How to create database from .sql file
how to create database from .sql file..?? i put the sintax query in a sql file.. and i want to call it in java code..
ho to do it..??why do you want to do this from java?
i just don't see the point.
find your dba and have him/her run it for you -
Create a database from scratch using php.
Is it possible to create the usernames and databases for
mysql using a php script, or can this only be done using
phpmyadmin.
if it can how.
thanksSure, you should be able to execute ddl command from a php
script. Why do you want to? -
How to create database from servlet?
Hey all,
I want to create database and store the tables in that database.
I don't have idea.
any help..
the concern is...
I am using WSAD as a IDE.my backend is Oracle.
First ,I need to check if user having ms-access in his system.if yes
then I need to create datbase in that ..and store some tables in that database .
any sample code snippet helpful for me..ok.Thank you.
I am developing business application.The users enter some data.and I am storing that data into the oracle database.
for every month...they need to check again that data and validate.
for that...I want to create MS-access connection and get (oracle ) those data and store in ms-access ,I need to give link for that data to validate them. after that I will update.
I don't have any idea how to store the data after i am retrieving data from the oracle database.how to generate link to that.
now...I am trying to create database connection to the MS-ACCESS.I am
using WSAD 5.1.2 VERSION.and jdk 1.4 version.
below is my code..for connecting ms-access..
System.out.println("start connect");
try {
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
} catch (Exception e1) {
e1.printStackTrace();
System.out.println("connected..");
Connection con=DriverManager.getConnection("jdbc:odbc:msd","","");
Statement stmt=con.createStatement();
result=stmt.execute("create table test(col1 char(10))");
System.out.println("the success");
its giving below error. I know that the classpath error.But where I need to give that classpath .I think I need to get driver software from somewhere.please any suggestions......
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java(Compiled Code))
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java(Compiled Code))
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at java.lang.ClassLoader.loadClass(ClassLoader.java(Compiled Code))
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at java.lang.Class.forName1(Native Method)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at java.lang.Class.forName(Class.java(Compiled Code))
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.philips.servlets.DBGenerationServlet.dbCreate(DBGenerationServlet.java:102)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.philips.servlets.DBGenerationServlet.doPost(DBGenerationServlet.java:87)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.philips.servlets.DBGenerationServlet.doGet(DBGenerationServlet.java:73)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
[4/7/06 19:32:53:699 SGT] 7f4721ba SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
[4/7/06 -
How to create a disconnected license using User-based license in the Volume License Manager
Using VLM 2.0, how do you create a disconnected license for users who are set up for User-based license?
Hi Jordan:
Please see the following knowledge base entries that should help you out.
http://digital.ni.com/public.nsf/websearch/7AE8E22CB83D604286257088006D452A?OpenDocument
http://digital.ni.com/public.nsf/websearch/28CACF3A4F81FB5C86256F5D0081D046?OpenDocument
http://digital.ni.com/public.nsf/websearch/B12A9ED8FC06A9B286256E6A00671018?OpenDocument
Thanks
Nandini
NI -
How to access database from applet using connection pooling.
Hi,
I am using tomcat 4.1, JRE 1.4.2_10, MySQL 5.0, and IE 6.0. I can access the database using connection pooling from JSP without problems. But, if I try to acess from the applet, I get the following exception (related to JNDI.):
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
I know what this acception means, but I don't know how to fix it. I set up connection pooling in my Tomcat 4.1 that talks to MySQL 5.0. As I said, when I access from jsp, JNDI works. But, applet complains. Please help. In my applet, the following code accesses the database:
ArrayList toolTipData =
access.getToolTipData (projectName,interfac);This is the snipet of my Access class:
public ArrayList getToolTipData (String projectName, String interfac) {
System.out.println("In getToolTipData");
ArrayList toolTipData = new ArrayList();
try{
Context ctx = new InitialContext();
if(ctx == null )
throw new Exception("No Context");
DataSource ds = (DataSource)ctx.lookup("java:comp/env/jdbc/interfacesDB");
if (ds != null) {
Connection conn = ds.getConnection();
if(conn != null) {
Statement s = conn.createStatement();
//For some reason paramtized queries don't work, so I am forced
//to this in slighly less eficient way.
ResultSet rst = s.executeQuery("select * from interfaces");
while (rst.next()) {
if (rst.getString("Project_Name").equals(projectName) &&
rst.getString("Interface").equals(interfac)) {
System.out.println("getToolTipData: ITG #" + rst.getString("ITG"));
toolTipData.add("ITG #: " + rst.getString("ITG"));
toolTipData.add("SPNE Prime Name: " +
rst.getString("SPNE_Prime_Name"));
toolTipData.add("PD Prime Name: " +
rst.getString("PD_Prime_Name"));
toolTipData.add("IT Prime Name: " +
rst.getString("IT_Prime_Name"));
toolTipData.add("MLC Priority: " +
rst.getString("MLC_Priority"));
toolTipData.add("Gary's Prime: " + rst.getString("Garys_Prime"));
toolTipData.add("QA Prime: " + rst.getString("QA_Prime"));
toolTipData.add("Brief Description: " +
rst.getString("Brief_Description"));
toolTipData.add("Project_Status: " +
rst.getString("Project_Status"));
conn.close();
}catch(Exception e) {
e.printStackTrace();
return toolTipData;
....The jsp runs on the server, whereas the applet runs on the client so
you must package with your applet any jndi implementation specific classes
and
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
props.setProperty("java.naming.provider.url", "url:1099");
Context ctx = new InitialContext(props);
Object ref = ctx.lookup("..."); -
Problems creating notation from scratch using the edit function of GarageBa
I am using garage band to write music. I open
a blank loop with a grand piano system instrument and
begin editing. I encounter the following problems:
1. The software does not allow me to enter any note
below middle c on additional or ledger lines that
should be available below the stave of the treble
clef.
1.1 Connected to this issue is that it is very
difficult to write music that contains subtleties.
This directly affects the way the music sounds. The
program substitutes accidentals in the stave
conditioned by the key signature. For example writing
Chopin in GarageBand as opposed to the written sheet
music is the difference between buying a designer
dress in a Bond Street Boutique and buying a cheap
copy in Primark. "Brins Bungalo" Tutorial claims
that
Garageband "is an application suitable for both the
dabbler and the conservatorially trained."
2. When there are many notes to be entered in a bar
garageBand is not flexible to accomodate the notes
required, Notes are clustered in a bunch makiing it
difficult to read what has been written (preventing the composer checking that it has been written correctly).
3. When there are many notes to be written in a bar
e.g. more than, say four notes, (lots of quavers or semi quavers) the
program does some strange things which I am unable to
control:
a) groups unrelated larger notes with the smaller
notes and will not allow them to be separated;
b) changes the value of notes already entered;
c) sometimes splits the note being entered into two
smaller notes joined by a tie;
d) accidentals appear on notes entered or notes
already entered without my instruction;
e) it changes note values, filling up the bar, to the
value of the time key before I have a chance to finish
entering the remaining notes that I want to place in
the bar;
4. How is one able to enter "dynamics" (symbol marks
of expression). I know it is possible because many of
the preloaded loops have these expressions evident
within them. I have tried consulting GarageBand Help but this has proved impossible to fathom.
Can anyone help?
iMac Mac OS X (10.4.8)You have my sympathy as I also wanted to enter notes on a stave but GB is simply not designed to do it.
You can do an amazing amount with GB but complex scoring is not really possible. You can't print a score btw.
In answer to some of your questions,
Expression cannot be added using the scoring facility. You need to go back to the piano roll view and use the expression/modulation/pitchbend/footswitch parameters.
I think you're possibly doing something wrong as I've just done a little test and I've entered a C0 without a problem.
I've also not had problems moving notes about and getting the right length or having GB fill notes to the end of the bar.
This is how I do it.
Create a software track.
Double click on the track to get the track editor.
Press record and use the the keyboard on the piano roll to enter a note. You've now created a recording region. You can't enter notes outside a recording region so you might need to drag it out to the required size.
Swap to note entry. That gives you the double stave. Drag the grey bar that separates the arranger area from the track editor upwards. This gives you more space on the stave.
Command click anywhere on the stave and a note will appear. Just move that note to wherever you want it and click to set it in place. You can always move it again by left clicking on the note and dragging it.
Accidentals will depend on the key you've set for the song and what notes you're entering. In D for instance you won't get an accidental for F sharp but you will get one for A flat.
Let us know how you get on.
If this still doesn't give you what you need then I suggest a dedicated notation package. Create a midi file from the package and import into GB for final tweaking.
Cheers
Dick -
How to create DTD from XML using DOM
Hi,
Is there a way to create a corrosponding DTD of a xml-file using DOM. I have a XML-file that's pretty huge I want to create a DTD for that XML-file using DOM. Can anyone plz. lead me how to do this. I tried to use XMLSpy to convert the XML into DTD but the resulting DTD is not correct. Is there a way to create the DTD using DOM.
Any help is really appreciated. ThanksWhen you say you are trying to convert XML to DTD, do you mean you are trying to convert a XSD (schema) to a DTD, or that you are trying to create a schema that corresponds to a given XML document.
Realize that DTDs are not very powerful. XSD documents allow for much more detail. I don't have a proof, but I'm absolutely confident that any DTD can be expressed as a schema but not all schemas can be represented as a DTD. In other words, DTDs are not worth the trouble, in my opinion. -
If ur database crash u have only export of database how u create database f
if ur database crash u have only export of database how u create database from starting with help of export give steps
What is an "export give steps?"
If ur's database crashes, how is it u's responsibility to restore it?
Now, if my database crashes, I just restart it in crash recovery mode and not even worry about the backup or export. It is not needed. -
How to create database link from oracle to sql server
Please help with how to create database link from oracle to sql server
Best regards,
VishalPlease help with how to create database link from oracle to sql server
Best regards,
Vishal
Hi Vishal,
I found a lof of information regarding how to create a database link from Oracle to SQL Server, please see:
https://www.google.co.in/?gws_rd=cr&ei=vd3XUvGFO8TgkAXqlYCADg#q=how+to+create+database+link+from+oracle+to+sql+server
We discuss SQL Server related issue in this forum. If you have any more question regarding Oracle, please post it in Oracle communities forum for better support.
Regards,
Elvis Long
TechNet Community Support -
How to create database using shell script
hai
how to create database using shell scriptThe documentation details the steps to create a database manually. Another option is to use DBCA to create the scripts. DBCA will give you a complete set of scripts that will create a database.
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14231/create.htm#sthref220 -
How to know active user in Ad ? & how many days from not use user id ?
How to know active user in Ad ? & how many days from not use user id ?
Thanks & Regards, Amol . Amol DhaygudeHi Amol,
You can use the below command from the command prompt of DC to get all the AD users who are inactive for last
X weeks,
dsquery
user -inactive X
To extract the inactive user information to a CSV file use the below command,
dsquery user -inactive X > c:\TestFolder\InactiveUsers.csv
NOTE: The value
X represents number of weeks, for example if your requirement is to find the inactive users for last 90 days then the
X value should be 13.
Regards,
Gopi
JiJi Technologies -
How to Create PDF from Illustrator CS3 by using applescript?
Hi Guys,
Do some one knows how to create PDF from Illustrator CS3 by using apple script. If know, please give me the scripting.
HARIHave you tried File>Scripts>SaveDocsAsPDF? There should be a folder of sample scripts installed in your AICS3 folder and a folder of documentation which contains an Illustrator AppleScript Reference which has examples.
-
Not able to connect database from another os user using externally?
Hi,
I want to connect database from another os user. i am able to connect database from oracle externally. but not able to connect different OS user.
As ORACLE User:
[oracle@test1 admin]$ sqlplus /
SQL*Plus: Release 11.2.0.2.0 Production on Mon Jan 16 19:41:57 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
Non ORACLE user:
[sample@test1 ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0.2/
[sample@test1 ~]$ export ORACLE_SID=rman
[sample@test1 ~]$ export PATH=$ORACLE_HOME/bin:$PATH
[sample@test1 ~]$ sqlplus /
SQL*Plus: Release 11.2.0.2.0 Production on Mon Jan 16 19:37:42 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0
Enter user-name:
ThanksYou didn't install Oracle correctly, especially you didn't run the root.sh and rootpre.sh scripts.
If you would have read the error message at all, and researched it, you would have known this.
Regrettably however you decided to ignore Forums Etiquette and to abuse this forum with Yet Another Doc Question.
Sybrand Bakker
Senior Oracle DBA -
How to create a crystal Report using C# and SQL Server
Hi, im new in creating crystal report using SQL Server, and im making a project.. and could someone help me how to connect your .sdf (SQL Server File) from the bin to your crystal report? thanks a lot.. i followed some instructions like this one (https://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?referrer=http://social.msdn.microsoft.com/Forums/vstudio/en-US/48c0dd48-5b23-49da-8601-878f8406125e/how-to-create-a-crystal-report-using-sql-server-visual-c?forum=csharpgeneral)
but i got an error on the adding of server name and database portion.. thanks a lot in advanceHello,
Crystal Reports are supported on
http://scn.sap.com/community/crystal-reports.
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book:
Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})
Maybe you are looking for
-
How can I transfer photos from my computer to my iphone
My iphone doesn't accept photos when I try to transfer from my computer to my iphone.
-
Hi everyone, I format my Mac today and previsously save the safari folder from library so I have all the bookmarks and other stuff. After install OX S I copy the folder again but now when I open safari the previous tabs and windows didn't open automa
-
Newbie: Simple Reads, Transactions, Pooling and Code Form
I am currently refactoring a set of code (assembly) called by a windows service that provides persistence to an Oracle DB (DataAccessComponent). The motivation for the request to perform this work was to reduce connections to the Oracle DB. The most
-
Using MLS exchange with a mac? Does anyone know how?
Ok, so I'm new to the real estate world and for some reason everything out there is not compatible with a mac and it is very frustrating! How am I supposed to work from home if I can't even get onto the MLS system. It says you have to use Internet Ex
-
Problems with the Application Module Pool
Hello, We have an Oracle ADF Application working in a production enviroment. The application module pool seems to work properly during the first days, but after a few days, the application module pool seems not to work properly. We start to get some