database

Mapping a byte[] that can grow up to 400KB on MySql

Hi, I have the following: @Entity public class ExamplePhoto { ... @Column(nullable= false) private byte[] photo; ... } I am using Hibernate and a MySql database. I tried putting a mediumblob but got a "tinyblob expected error" message. Given the fact that the photo could be of up to 400KB the tinyblob won't do the job. How can I m...

How sequential traversing between intermediate leaves of clustered index used?

Intermediate leaves of clustered index are linked sequentially (next, previous) for faster access (between intermediate nodes) [2], [3], etc.: How this access is used? Why is it needed? [2] Clustered Index Structures http://msdn.microsoft.com/en-us/library/ms177443.aspx [3] Clustered Tables vs Heap Tables http://www.mssqltips.com/...

searching different value in one column

i have a transaction table like this cust_id | item --------------------- 1 | book 1 | shoe 2 | book 3 | shoe how can i use SQL command to find customer who bought book and shoe together? so, the result can be only customer 1. I need to do Apriori project, iv try to google, but i dunno the correct phrase to be...

Which database would best suit the following needs?

I am trying to work out the best database(s) considering the following requirements: The bulk of the data is "document" style, with specific common fields that will be indexed. There needs to be joining across these indexed fields. However, the data in the indexes is heavily hierarchical, i.e., graph. A specific example is the hierarch...

MySQL data types: int versus enum

I have a number of columns that only need to store a few values (e.g. 0, 1, 2, 3). What datatype should I pick for such a case? I feel like I should pick something like ENUM('0', '1', '2'). Would int be better (despite it being less restrictive)? Should I consider something else (like tinyint)? EDIT: Actually, what general advice shoul...

Programming for various database

I'm wondering for those enterprise programs, how do they link to various type of database just by stating the connection string? Issues like different syntax, variable type will definitely be there. Apart from stored procedures for each type of database, how else do they handle in terms of their programming? 1 way that came to my m...

Looking for a web-based log collection/display application

A project I'm working on currently involves using a disparate set of technologies, including .NET, PHP, Asterisk and bash scripting. Each of the applications in use produces some logging; technical logging for administrators and user logging. The technical logging is easy, all logs are written to disk as text files. For the user logging...

AdvantureWorks Hirarchy

Hi everybody. I have a question about AdvantureWorks. What is the query to determine the full hirarchy of an employee's managers? example: Alex is the input Sara (Manager - Level 1) James(Manager - Level 2) David(Manager - Level 3) Alex(Simple Employee) ...

Exporting tables and indexes from one SQL Server 2000 database to another

I have a SQL Server 2000 database and some tables in a database. I want to export them (the structure, definition and indexes) to another database. I don't want to copy the entire database, only some tables. And it doesn't matter the data that I have in the tables. Is there a form to do it?? I know the export data option but I've tri...

how to allow android to access/modify a remote database

I'm running a .net aspx application. I'll need my android app to access and modify/insert information into the ms sql database. is there any api ? thank you ...

.dbo and .mdf in Visual Web Developer - some kind of mixup

I am really confused about the .dbo schema thing. Here is my issue: I have a website I'm building in VWD and I connected it to a database that I built in SQL Server Management Studio. The website works to pull up items from the database. However, I made changes to the database and they didn't show up in the website. I looked in the Datab...

DB2 creating event monitor

Hello, I'd like to create event monitor on DB2 z/OS 9.2 i have spent a lot of time trying resolve this problem. So i suggest this link: http://www.ibm.com/developerworks/data/library/techarticle/0303kolluru/0303kolluru.html and trying to make this steps: db2 => connect to dbname user username using password db2 => update monitor...

For a beginner, is there much difference between MySQL and PostgreSQL

IS there much difference between MySQL and PostgreSQL for a beginner like me, using basic select statements and the like, or are the main differences with using more advanced queries? ...

Independent DAL Design - Specific and Generic

Scenario: Creating an app for learning purposes and am trying to make it database independent. I have looked at the beerhouse architecture quite a bit where each database has its own dal an a mixture of SqlCommands and DataReaders etc. I no theres not a definite right or wrong, but generally in terms of maintenance, speed etc baring in ...

No such table exception in android

Hi! I have next stuff: private static final String DB_NAME = "MyDebts.db"; private static final String CREATE_DB_QUERY = "CREATE TABLE " + Dao.CONTACTS_TABLE_NAME + " (ContactId varchar(64), Credit integer);\n" + "CREATE TABLE " + Dao.SETTINGS_TABLE_NAME + " (Name varchar(64), Value varchar(64));" ; @Override public...

My blog.php file in my admin section is not showing all of the posts in the database

I have a php file in the admin section of a website I built. The file pulls posts from a certain database and corresponding table spits them out onto the page with a Edit button link to edit that specific post. All of this is working properly. However at the moment the database says there are 15 entrys in the table, yet only 12 are viewa...

Connect to failover db in PHP.

In php is there a quick way to say if db1 is unavailable connect to db2 instead? Here is what I'm doing now: $username="XXXXXXXXX"; $password="XXXXXXXXX"; $database="XXXXXXXXX"; $hostname="XXXXXXXXX"; mysql_connect($hostname,$username,$password); @mysql_select_db($database) or die("unable to select database"); ...

insert or update confusion

Hi everyone, I'm a bit confused about how to handle the situation where you update a row in sqlite if it exists, or insert it if it doesn't. I seem to see a different solution on every answer there is to this problem. Whats the most efficient or easiest way? EDIT: I meant sqlite, sorry ...

Mysql replications: slave is not readonly

Hi! After setting up mysql replications with master/slave db scheme, I noticed that the slave db server is not read-only. Of cause, after that I configured it manually in /etc/my.cnf file. I just can't understand: isn't it the default behavior that the slaves are always running in the read-only mode or it should be always configured by ...

Read data from multiple rows PHP MySQL

I have a database to keep track of the services clients have. But need to be able to find all the services (on different rows) and display them in an HTML table. i.e. Service Company Status ------------------------------------- Service 1 Company 1 Complete Service 2 Company 2 Pending Service 3 Company 1 ...