This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!


+ Follow
since Dec 11, 2000
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by E

Is this an Oracle issue or a JDBC one?
More to this: MS Access and IBM's DB2 also support the identity property. All databases do this in their own particular flavour.
You don't do this with a JDBC statement. In SQL Server this is an identity column. You create this column in your create table statement. Oracle 8i has something very similar. Basically you create a type int column and tell it you want to be an identity column. In SQL Server, the default increment unit is '1', starting at '0'. This can be changed by providing seed values.
If your table is already created, you can copy the existing table by doing a select into 'theTemporaryTable', drop the original table, recreate the original table with an identity column, copy the data back in.
When working with a table with an identity column, you do not include the identity column when doing inserts, just the regular columns. The database will automatically create the next value and insert it into the record with the rest of your data.
Microsoft's documentation for SQL Server is, for Microsoft, unusual, in that it is absolutely fantastic. However it is online. So... check the SQL Server Boos Online for more info.
Without doing it using an identity column, there are any other hoops to jump through. The key is to ensure that the 'next' value you are going to use isn't already taken by another user who is doing a simultaneous update. This won't be an issue with an identity column.
Hope this helps
Check SQL Server Books Online for this database specific question and examples. Specifically research the create table statement. Here is how to set up the foreign key (which is what you call a reference). Add this at the end of your column list:
CONSTRAINT FK_fkey_name FOREIGN KEY (person_id, ord_id, chicken_id)
REFERENCES barnyard (person_id, ord_id, chicken_id)

The first column list (after the foreign key) is the list of columns in the new table corresponding to the primary key columns in the 'parent' table. The references is of course, the parent table.
It should look something like this:
feed_type int,
farmer_name varchar(50),
Interesting thread.
Let me get this clear:
strings are immutable, but Strings aren't?
20 years ago
Having an array list, which of course contains objects, when I get an object out of the list, is there a way to determine the actual instance of the object dynamically at runtime?
For example:
extendedJPanel myPanel = new extendedJPanel();
ArrayList theList = new ArrayList();
Object o = theList.get(0);
Now what I am trying to do is call a method in extendedJPanel after pulling it out of theList. However, I would like to dynamicly determine that 'o' is the instance object 'myPanel' so that I can do something analogous to:
but using the object, or the instance information extracted from it. Is this possible? If so, can someone give me a simple example?
20 years ago