Basic question on SQL database file structure

I'm learning to use JDBC / databases . I'm using JBuilder3 professional and HSQL (aka Hypersonic). I've
been following the Java Tutorial on learning databases.
So far I've sucessfully
set up the drivers / URL etc
connected to the URL
created a database (COFFEEBREAK , as per the tutorial)
added tables
added data
queried the database
------------- with the tutorial , so far so good. --------
My only database experience prior to this was using Microsoft access, where tables, data, queries etc are all
stored in one file <myfile.mdb>
But with the example I am following, not one but 4 files have been created:
COFFEEBREAK.data
COFFEEBREAK.backup
COFFEEBREAK.properties
COFFEEBREAK.script
the COFFEEBREAK.data file, looks like this (one line) in a text editor:
padding="0" cell
After I added data , using SQL ,I was expecting this file to grow ("as data rows were added") , but no change at all - still just one line.
The file that DOES change is the COFFEEBREAK.script file. The SQL instructions get added to the end of the file eg :
<various lines>
INSERT INTO FILES VALUES('.\COFFEEBREAK.properties','COFFEEBREAK.properties')
INSERT INTO FILES VALUES('.\COFFEEBREAK.data','COFFEEBREAK.data')
INSERT INTO COFFEES VALUES('French_Roast',49,8.99,0,0)
INSERT INTO COFFEES VALUES('Espresso',150,9.99,0,0)
INSERT INTO COFFEES VALUES('Colombian_Decaf',101,8.99,0,0)
INSERT INTO COFFEES VALUES('French_Roast_Decaf',49,9.99,0,0)
I had been expecting a single file ( a la Microsoft access) , with the data in it and not readable in ascii form.
Am I misunderstanding the structure of SQL / DBMS files , or is this just a pecularity of Hypersonic ??
How do I ship a finished Java application where a database can be interrogated - will the *.script file have to be shipped too? If so , all the data is there , so how is the DBMS password protected?
I'm confused ! Thanks in advance
M.

Thanks again for the response trejkaz.
If the database were encrypted, you could just use an ordinary SQL query tool to dump >> all the records to a text file, which would be just as readable as the .script file!I had in mind if the user name was "Bill" with his (self selected ) password "hisPass" then the encryption key would be derived from a mangled version of those two bits of data (eg qazBillwsxhisPass or whatever). As long as the mangling mechanism was secret hopefully that would stop access through regular SQL query tools.
You're giving them the software to read the database anyway .. what's the difference if they >> read the info from the flat file, compared to reading it through a program? Through the program the data is view only (maybe with a limited subset of the fields for printing). With a flat file a potential competitor gets a jump start by having an electronic copy to bootleg.
Two examples occurred to me, one simple & one closer to what I'm trying to achieve
1) An example of a multiple choice database for students where the computer tells them how they have done - couldnt the students just look up the answers beforehand in the script file ?
2) (hypothetical example) Suppose I'm an expert on gardening & I want to set up 'electronic garden advice' Inc. I prepare a database, say about 3000 records. A typical record may have a layout based on :
question
question ref. number
region
garden style ref.
plant type main
plant type sub
disease-prone?
commercial/non commercial
criticality weighting %
substitute plants
recommended treatments
preferred season
etc . Most of us can imagine more possible fields
Anyone can pay the $ , download the database & set themselves up as an expert, maybe extracting sub sets of the data, depending on their customers needs.
But any printouts might only have say the question & question number so the whole database woulnd't be printed to a text file from my Java app . (The non printed fields are used within the Java app say for cross referencing alternatives etc) so the whole database couldn't be downloaded via a print routine to a text file.
At the moment my options seem to be:
1) different SQL database , where the data isnt stored in ascii readable form
2) Just use a csv text file instead of dbms & write my own encryption
3) Encrypt the HSQL script file, have the java app decrypt it to a temp scratch file & load that way . (the problem there seems that in a multitasking OS, the user just copies the scratch file)
4) somehow do the decryption after loading from an encrypted script file but before presenting the data on screen.
5) any other ideas you can recommend...?!
Apologies for the long response, my thoughts on this are still evolving
Thanks again
Mike2z

Similar Messages

  • How to attach/restore the sql database/file extension (*.File)

    I took backup the database long back ago. Now I
    am unable to attach/restore the sql database/file extension (*.File). I
    have the file type called (*.File) which i need to attach/restore. Can anyone tell me what's are the steps
    taken to do this? 
    Thank in advance.

    Database
    name-->Right Click-->Tasks-->Restore-->Database-->Select "Device" radio button-->Click device Path button-->Click "ADD" button --> I tried with "All Files(*)"--> then i selected my database-->ok-->ok-->ok -->
    then i am getting below error. 
    I am unable to post image. 
    "Restore of database 'Databasename' failed. (microsoft.sqlserver.management.relationalenginetasks)"
    Additional Information:
    System.Data.SqlClient.SqlError: The database was backed up on a server running version 8.00.0194. That version is incompatible with this server, which is running version 11.00.2100. Either
    restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.SmoExtended).
    Can
    you please help me to solve this error.
    Thanks,
    Laxmi.

  • Basic question about importing wma files

    Hi, I have a basic question about importing wma files. I ripped some cd's on a Mindows computer using Media Player, but now want to copy them to my Mac and use them in iTunes on my Mac. when I use Import in iTunes, nothing happens and I cant even seem to copy them one by one using the Music folder.
    Can someone help me?
    thanks
    eMac   Mac OS X (10.4.4)  

    iTunes for Mac doesn't support .wma files.
    If you can use a PC to convert them, you can use one of many freeware applications. Google for 'wma to mp3'.
    For the Mac there's the shareware program EasyWMA that can convert them.
    Hope this helps.
    M
    17' iMac fp 800 MHz 768 MB RAM   Mac OS X (10.3.9)   Several ext. HD (backup and data)

  • How to attach sql database file to creating .exe setup in c#

    I create a Setup file and put data folder, in data folder i put database file , but the problem is i have to mannualy attach database file in sql server 2005. I have to automatically attach database file when installing setup file.

    Hi
    bhagvad,
    Welcome to MSDN Forums!
    We can implement auto attach database just use the connection string following.
    1)      
    Add a folder named ”DB” to the project, and copy the database file into it after you detach it from your sql server.
    2)      
    Change your connection string like this:
        <connectionStrings>
            <add name="WindowsFormsApplication1.Properties.Settings.BabakConnectionString"
                connectionString="Data Source=.;AttachDbFilename=|DataDirectory|\DB\Babak.mdf;Initial Catalog=test;Integrated Security=True"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
    3)      
    After these, the database file will auto attach to the sql server when you run your application, and the database name is “test”, you can open the sql server
    management studio to find it.
    In addition, you can find the connection in the app.config file through the solution explorer in vs2010. And you also can find this file under your project. With
    these information, you can find it and modify it.
    If there’s anything unclear, please feel free to let me know.
    Best wishes,
    Mike
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually
    answer your question. This can be beneficial to the others community members reading the thread.
    when i try this i have an error from the computer. in my computer just microsoft server 2005 installed. and i need to setup my project. 
    <add name="TelekomEthernetApp.Properties.Settings.TelekomEthernetConnectionString" 
           connectionString="Data Source=.;AttachDbFilename=|DataDirectory|\DB\TelekomEthernet.mdf;Initial Catalog=test;Integrated security=true" providerName="System.Data.SqlClient"/>
    what is the problem?
    http://img31.imageshack.us/img31/2305/asdet.png

  • How to locate SQL database files

    Over the years I've used and discarded any number of applications, many of which created SQL databases.  I'm trying to clean out various odds and ends and would like to know how to search for anything SQL.  I know, for instance, that mail.app uses SQL but I have no idea where to find the database (not that I want to delete Mail!). 
    I'm comfortable using Terminal if that's the way to go.
    Any tips on locating hidden SQL databases would really be appreciated.
    Thanks!

    Similar to when users delete mailbox content, moving user mailboxes doesn't reduce the size of the edb file.  Instead, the database simply gains "white space" which will be filled in before the edb grows any further.  Once your users
    are vacated, you can remove the databases from AD per the cmdlet mentioned above.  as a safety measure, that cmdlet doesn't delete the actual edb files, but once you've run it, yes, you just go and press the delete key on the files.  Obviously "ctrl+a"
    means all files, which isn't what we're talking about.  Just the database and associated log files.
    Mike Crowley | MVP
    My Blog --
    Baseline Technologies

  • Splitting large sql database files

    Hi
    I have large sap sql server data files having size in 40 GB/ 3 data files. Is there any way to split those data files into smaller size  .
    Thanks and Regards
    Jijeesh

    Hi Jijesh,
    There is a way of splitting files without hampering performance, I have done this on a production system without loss of performance.
    All data files in MSSQL belong to a FILE Group, suppose there are 4 datafiles in your database each of 4GB, assume all files belong to the same filegroup.
    file1.mdf
    file2.mdf
    file3.mdf
    file4.mdf
    and you want to split each into 2 GB datafiles here is what you do.
    (Before starting Take Complete Offline backup of your database by stopping SAP and performing a full offline backup of all data and log files.
    This operation technically could be performed with SAP Up and running , however its safer to keep database idle when doing a reorg, so stop SAP instance and do the following.)
    1.We select the file file1.mdf
    2.Add 2 new files to the same filegroup as file1.mdf and name them as file1a.mdf and file1b.mdf of size 2GB each.
    3.RESTRICT growth on all rest files (file2.mdf, file3.mdf and file4.mdf) by unchecking the Auto grow option.
    4. Open the SQL Analyser and give the command:
    <b>         USE '<SAP SID>' ;
             GO
             DBCC SHRINKFILE 'file1.mdf'  EMPTYFILE;
             GO
    </b>
          The above mentioned commands will empty the contents of 'file1.mdf' and restribute the data to other files in its FILEGROUP.
    Now we have restricted growth by TURNING OFF growth on 'file2.mdf' , file3.mdf and file4.mdf.
    The command will distribute data to the new files created by us file1a.mdf and file1b.mdf.
    When the command has completed, you can safely remove the file1.mdf
    5. Perform steps 1-4 for all the remaining files file2.mdf and file3.mdf and file4.mdf.
    After doing the above operation run a CHECK DB using DBCC CHECKDB , this will ensure that your database integrity is checked and everything is okay.
    Now run Update statistics to ensure that your performance will not be hampered.
    Regards,
    Siddhesh

  • Basic question about Flashback Database

    Hi,
    I have a very generic question about using Flashback Database.
    On my testing systems, for performance testing and simulation purposes, I want to create a guaranteed restore point so I can test impact on batch when code change releases are done, before deployment in production.  My confusion is with respect to redo logs, as summarized in the questions below:
    1. Is it possible to change redo log files, when a guaranteed restore point has been configured?
    2. If yes, will the Flashback to restore point, also change the size of the redo logs?
    I could not find anything in the docs about this....hence my question....
    Appreciate your time taken in responding to these questions....
    Regards.

    HI,
    donneskold wrote:
    Hi,
    I have a very generic question about using Flashback Database.
    On my testing systems, for performance testing and simulation purposes, I want to create a guaranteed restore point so I can test impact on batch when code change releases are done, before deployment in production.  My confusion is with respect to redo logs, as summarized in the questions below:
    1. Is it possible to change redo log files, when a guaranteed restore point has been configured?
    1) Yes it is possible.
    2. If yes, will the Flashback to restore point, also change the size of the redo logs?
    2) It will not change the size of redo log file.  Cannot resize a redo log file..
    I could not find anything in the docs about this....hence my question....
    Appreciate your time taken in responding to these questions....
    Regards.
    Thank you

  • Very basic question regarding drag/drop files in 10.6.5

    Just (finally) updated to Snow Leopard and the simple way of dragging a file to the bar (just above the list of items in the folder) so as to move it to that folder no longer works.
    I prefer not to drag it to above other files in the folder and hoping that the file won't end up in a folder (which has now happened several times).
    There must be a simple-no-brainer way of doing this as there was before in 10.5 and as far back as I can remember (been using Macs since the mid-90's).
    Why did Apple decide to change this? Did they find a simpler way that I haven't figured out?
    Thanks for any advice.
    RonL

    MacRumors forum answered my question almost immediately... and yes they acknowledged that Apple had changed this in Snow Leopard for no good reason.
    On both my Leopard and Snow Leopard systems, you cannot drag a file to the title bar (not the "name bar"). On both systems, you can drag a file to the empty space in a window. I just tested to make sure. So, either your description of the problem is completely and utterly inadequate, you are misunderstanding what was said on MacRumors, or someone on MacRumors doesn't know what they're talking about.
    How long have you guys been using Macs?
    26 years, like baltwo. As a Mac support professional, programmer, web designer and more. I've forgotten more about Macs than you have ever known, I'm sure. Nobody here is impressed that you have used Macs for a little more than half that time, and your rudeness is most definitely not appreciated.
    It's one thing to not give me an answer... no problem, fine, but it is an entirely different thing to say that what I have done for years, and that has worked easily for me, has never worked.
    You claim that it changed with Snow Leopard. Clearly, it did not. As I've said, I have both Leopard and Snow Leopard systems and have verified that as fact. Once upon a time you could drag to the title bar, but I honestly don't have any idea when that behavior changed. I'd guess in 10.0, but have no way to verify that at this point.

  • Some basic questions on File Adapter

    Hello all,
    I have some basic questions on XI and File Adapter and hope you can help me. Any answer is appreciated.
    1. Can I use NFS transport protocol to poll a file from a machine in the network, which is not the XI? Or do I have to use FTP instead?
    2. If I understand it correctly - when using the FTP-File Adapter, XI has the role of a ftp client. I have to run a ftp server on my distant machine. XI connects to FTP-Server and polls the file.
    Can it also be configured the other way round? The scenario I think of would be: FTP client installed on distant machine, which connects to FTP-Server(XI) and loads up a file. So XI would act as FTP Server.
    I know this works, if I install a ftp Server on the computer my XI runs on, and use the NFS-File Adapter to observe the folder. But I want to know, if I need a second, independant ftp server for this.
    3. And last but not least: When do I need the active ftp mode instead of passive?
    Thanx a lot for your answers!
    Ilona

    > Hello all,
    > I have some basic questions on XI and File Adapter
    > and hope you can help me. Any answer is appreciated.
    >
    >
    > 1. Can I use NFS transport protocol to poll a file
    > from a machine in the network, which is not the XI?
    <b>yes</b>
    > Or do I have to use FTP instead?
    >
    <b>also you can do it</b>
    > 2. If I understand it correctly - when using the
    > FTP-File Adapter, XI has the role of a ftp client. I
    > have to run a ftp server on my distant machine. XI
    > connects to FTP-Server and polls the file.
    > Can it also be configured the other way round? The
    > scenario I think of would be: FTP client installed on
    > distant machine, which connects to FTP-Server(XI) and
    > loads up a file. So XI would act as FTP Server.
    > I know this works, if I install a ftp Server on the
    > computer my XI runs on, and use the NFS-File Adapter
    > to observe the folder. But I want to know, if I need
    > a second, independant ftp server for this.
    >
    <b>XI cannot act as FTP server, but it is always a client. When XI is reading (File sender adpater) when XIis writing than it is File Receiver adapter</b>
    > 3. And last but not least: When do I need the active
    > ftp mode instead of passive?
    >
    <b>It depends on your firewall configuration. The best and the fastests is active mode but not always available.</b>
    > Thanx a lot for your answers!
    > Ilona

  • Restoring a SQL backup file

    when attempting to restore a backup file to a SQL database file the restore failed and the error message referenced that the backup was from a "different" database.  Trying to restore a damaged database file created in the same version of
    SQL 2005.  Any suggestions that would "allow" the restore to work are appreciated.

    the error message referenced that the backup was from a "different" database. 
    When you try to restore to a different database, then you have to use the option "Overwrite existing database (WITH REPLACE)", otherwise you get this error message; it's a kind of protection, see also
    http://social.msdn.microsoft.com/Forums/en-US/6eb5b1aa-511e-44d2-b677-b2ba3303c84c/datavabse-restore-error?forum=sqlsearch
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Pl/sql vs sql basic question

    Hi,
    I have a very very basic question, so excuse me for that... I just would like to know the difference ( and the difference in usage) between sql and pl/sql?
    thank you
    Yann

    SQL - the structured query language - is the language available for extracting data from the database. It is a 4GL, and each command stands alone and performs a database action.
    PL/SQL is the 3GL primarily intended to control the flow of a series of SQL commands. PL/SQL does not, in any way, interact with the data in the database. It does, however, allow SQL statements to be called, or even created, in a specific order.
    SQL is capable of a LOT more than people usually realize. Unfortunate, as people often create PL/SQL programs when single SQL statements will do the job. I encourage reading the O'Reilly 'Mastering Oracle SQL' book ... only after fiunishing that book do I recommend any of Feuerstein's excellent PL/SQL books.

  • VBScript linking to SQL Database for file transfer information.

    I have been all over google and can't find anything that can use VBScript to look at an SQL database and based on what it contains, transfer files, I am not great with VBScript,
    still learning and at a BASIC LEVEL.  I can picture what I need but have no idea how to compose.
    The SQL database has 6 columns and I am trying to achieve the following.
    Database & Table : [FILE_TRANSFER].[dbo].[MAIN_FILE_TRANSFER_OUTPUT]
    Columns : [DESTURL1 ], [DESTURL2], [DESTURL3], [FullSource], [FullDestination], [DeleteFileAfterTransfer]
    Criteria required
    Does file exist within [FullSource]
    If yes Next if no, look to next [Fullsource]
    Does DESTURL1 exist No (Create) if yes Next
    Does DESTURL2 exist No (Create) if yes Next
    Does DESTURL3 exist No (Create) if yes Next
    Copy [Fullsource] to [FullDestination]
    (example : [Fullsource] c:\myfile.xls to [FullDestination] c:\thisismyfile.xls (Name change within [FullDestination])
    If [DeleteFileAfterTransfer] = Yes, delete transferred file [FullSource]

    TO extract SQL data to a file we would use BCP which is the main data extraction utility for SQLServer.
    Post you questions in the SQLServer forum and they will help you.
    There is no reason to use VBScript for this.  It is the wrong tool.
    ¯\_(ツ)_/¯

  • How to generate .SQL format file from oracle database?

    How to generate .SQL format file from oracle database?
    I have a database of Oracle 8.1.6,now want to generate script file (including table structure,index,etc.) from it,What should I do?
    Thanks.

    Your question pertains to the Database Export/Import. This forum exclusively focusses on the export/import utilities that come along with "Oracle Portal" which is a web-based tool. Could you please post your question under the RDBMS export/import or migration forum.

  • SQL and database file

    Hello.(sorry for my english)
    I have a legacy system , ported to opencobol that uses Berkeley DB. I can successfully open the database files using java both in windows and linux. However i want to create a web front end for the application.
    Data is stored using strange cobol structures (most numbers are stored as text or 4 bits per digit) and other fancy stuff.. so custom parsers should be written. (dont rember BDB classes name for that)
    I have been reading the documentation of Berkeley DB 12 hours totaly today but couldnt find answers to some questions...
    Is it possible to attach the database to dbsql.exe (sqlite) server ?? I tried to do "attach "..pathtofile" as NULL ,but i get multiple databases specified and not supported and other stupid messages....
    I think that what i tried propably doesnt make sense as collumns arent specified and nothing is in order this thing to work ..It is a simple Key value database.
    So i am a little stucked here.
    The only solution i can think is to synchronize with a relational Database. But i dont have triggers or nothing that helps....
    Note that i want one way synchronization. The "other way" will have very limited tasks.
    It seems to me that checking every x minutes if something changed using a cursor is a demanding task. So i am wondering.. Is there a way to track changes???
    Thank you :)
    Edited by: 843912 on 12 Μαρ 2011 7:13 μμ

    Hello,
    I am not sure I completely understand your question. If you are asking about importing
    and exporting data from a Berkeley DB database into an Oracle DB Table in Berkeley DB
    releases prior to 5.*, then this can be done with the Oracle OCI interface. If I am
    misunderstanding the question, please let me know.
    Thanks,
    Sandra

  • Storing pdf file in sql database

    currently i am working on my last semester project.I am using visual studio 2010 to design front end and sql server 2008 for database. I that case i want to store the pdf file in sql server 2008 databae and want retrieve it back as and when required.is
    it possible to do so please feedback me soon with an answer.

    look,
    http://stackoverflow.com/questions/2347842/storing-pdf-files-as-binary-objects-in-sql-server-yes-or-no
    Please use Marked as Answer if my post solved your problem and use
    Vote As Helpful if a post was useful.

Maybe you are looking for

  • Making Multi clips form one video in one export in final cut pro.

    I am looking to turn my video that is 45 mins in length in to 45 small 1 min clips. Can anyone tell me an easy way to export out the video in to 45 individual 1 min clips that will not need me to install more software or have to cut up the video and

  • 2LIS_02_SCL - Purchase Order History

    Hi All, Im working with 2lis_02_scl extractor,and when i executed a report i noticed that in the "Invoice receipt quantity (0INV_REC_QTY)" the extractor takes all the amounts that exists in the "Purchase Order History" Tabsheet in Tx(ME23N), so my qu

  • How to make a Java application that will change the client box's IP address

    HI how to make a Java application( that application would be run on the client ) that will change the client box's IP address ( IP address of itself )

  • Dropping internet service over and over?

    I have a cable modem (with turbo upgrade) hooked to an airport extreme, with two airport expresses in the house set to extend the network. It's worked great for months, maybe a year, but over the last couple of weeks I've been losing my internet acce

  • Is it Possible to link user defined column of system matrix ?

    HI All, Is it possible to link (with ExtendedObject) user defined column  of system matrix? For Example, In purchase order form, I have added one column called U_ItemCode (through Tools-User Defined Fields-Marketing Doc). I want to give drill down to