|
I doubt Oracle is going to put much into MySql when they had their own line of databases already, which seem to be much more favored in the business world. I think I may not have driven home the "free" vs "paid" point as heavily as I intended. A paid product generally has more money going into it (and open source tends to be free because you can't charge much when anyone can just download the source and compile it, so I often lump them together). It's simple economics, a product that doesn't generate much money can't have much cost behind it or it isn't profitable. Android may be free and open source, if Google wasn't making money on it, they wouldn't bother (consider: Google Play, ad supported free apps using Google's ad service, and more directly a few phones, especially now that they own Motorola Mobility, not to mention they probably charge companies using Android for support).
Also, Java may have had Sun and now Oracle behind it, but the whole thing feels pretty sloppy. Every time an update rolls around, our development crosses our fingers and hope it doesn't break something in our Java applications. Just today we found a bug in 7u25 that stops images from rendering...until Java is launched a second time. As I doubt out image rendering was using a security exploit or a bug in Java, there is no reason a security update + bug fix should have caused this. We had similar issues with the last update (at least the changes that caused that were documented, so we were able to fix it before any or our clients came across it).
We have never have these problems with out .Net applications. I honestly think Microsoft has put a lot more money and effort into their .Net platform.
|
|
|
|
|
Can the java team in your corp chooses to not update java, or test the updated version of java before running it with live system. Java update and affect the program is a possible big issue, but running a stable .net program in a windows version then later that windows is not supported anymore costs even more big problem. Let's say I run a program in XP age then now XP or that age windows server is not supported or updated, if I run the same .net program in current windows may has serious issue.
MS sql is more supported and stable, very friendly ide. For my trading program, I just use the mysql to store the data then only the program is running, I pull all data instead array and do calculation with arrays, so I don't need very advanced database functions.
I am going to use IB api and they have socket for java but only activex for vb/.net, and no example for c# at all, this is a big concern since even they official wrote there could be event lose with activex, that's mean if my trading program is automated later and trading at night while I sleep, it can have a buy order then a sell order event lost...then my future just up and down for awhile with luck.
|
|
|
|
|
crunchor wrote: Can the java team in your corp chooses to not update java, or test the updated version of java before running it with live system.
We can choose not to, but that doesn't mean our clients will listen. Especially since Oracle has decided to pop up a scary (from the user's perspective) warning message about their current Java being insecure, starting with 7u21. And it can't just be ours, the change that broke some of our code in 7u21 was bad enough that they added an option in 7u25 to disable the changed functionality. Not improved, or bug-fixing, as far as I can tell, they just decided that this existing function should suddenly behave differently in a patch. We've also found and reported bugs in Java itself, which were in turn acknowledged by Oracle (may have been Sun at the time) as a bug, and then told that they weren't going to be fixed.
In the .Net world, we have stuff originally written to run on .Net 1.1 that is still chugging along today, on top of various version of .Net form 2.0 to 4.5, with the only bug fixes being relating to the code we wrote, instead of the platform changing underneath it, and much more time to make enhancements. On the other hand, Java code written and compiled against Java 6 can't be guaranteed to run on the Java 7 VM the next day. (Obviously, we'd like to compile against Java 7 and gain access to the new features, but there's a lot of testing we have to do first.) I think the best example of the issue is this: for every version of our Java software, we release a list of supported Java versions, and it's down to the specific update of that version (e.g. there were a few updates of 6 we couldn't support, because of breaking changes in Java), but for anything .Net based, we only need to specify one version, and that's the minimum version (usually 3.5, because of new features added there that we use heavily). There's never a report of "hey, I updated .Net and now this program stopped working, but if I downgrade back to the previous version it works just fine", but with the Java stuff that is probably a semi-monthly occurrence.
crunchor wrote: Let's say I run a program in XP age then now XP or that age windows server is not supported or updated, if I run the same .net program in current windows may has serious issue. If Java updated as infrequently as you change operating systems, this might be a viable concern. And the only bugs in .Net apps I've come across that render them incapable of running on a newer version of Windows have been primarily from changes in the file structure (e.g., the move from using [drive]:\Documents and Settings\ to [drive]:\Users), which probably shouldn't have been hard coded in the first place, or to changes in file permissions (especially the fact that by default, Program Files can no longer be written to). I haven't seen any .Net related issues leading to this.
crunchor wrote: For my trading program, I just use the mysql to store the data then only the program is running, I pull all data instead array and do calculation with arrays, so I don't need very advanced database functions.
Then I don't see how the performance even matters if this is a once-per-execution event. Even assuming differences in perofrmance, they aren't likely to be enough to really matter once your program has finished execution (will probably also effect initial load times, but probably not substantially).
|
|
|
|
|
for live trade, I am not sure will it be involved database at this stage yet, but the speed matter for live trade. Current plan is analysis time frame between 1 second to 5 seconds data, but later may get down to ms unit. So the speed and stability to keep receiving correct live price/volume data, do analysis as fast as possible, send out order..all of these speed really matter in long run, especially when market moves very fast.
I agree Java update can be a very big concern, I wll do more research about this. I just start to build my trading system in an old laptop with unbuntu and not yet buying a new computer for this yet.
|
|
|
|
|
My thought is this: if speed is your concern, forget about both .Net and Java. C++ will give you better performance, and can be adapted for any major OS. Ditch the database altogether unless you really need it's features, instead opt for a custom file that can be directly mapped to memory if possible, it will be much faster. Choose an OS that is as minimal as possible to run on (e.g. a "server version" of a Linux OS is usually a good choice, it generally cuts out most of the extras you don't really need, like the GUI).
|
|
|
|
|
|
If you have already determined to your satisfaction which environment is faster, then start using it. People are offering answers to your query and you simply appear to want to argue with them and tell them why your preference is better.
If you have a question ask; if you want to argue, go elsewhere.
|
|
|
|
|
crunchor wrote: while Java development time is much less than C++
Sure, initially. But if you're looking at something where time is crucial, how much development time will it cost to write it in Java, find out it's too slow, then to re-write it in C++?
|
|
|
|
|
java is fast enough for my case. Only HFT level needs C++.
|
|
|
|
|
As with the other thread that you have asked about this the comparison about the languages is obselete it is how the operating system handles the executable.
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
Do you guys think Java is designed to be more native to Linux so it can run that fast?
|
|
|
|
|
You given too little information.
How many transactions per minute or per hour?
How many connections etc?
What sort of transactions will they do?
What sort of database / table size are we talking?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
To keep this simple. Let's say I have a table with three columns called mineral, vegetable, animal. Is it possible to select this table's records and list them in column order animal, mineral, vegetable? I know I can do it by specifying the column names like "select animal, mineral, vegetable from whatever" but I have some tables that have an awful lot of columns and sometimes it's easier to navigate the records if I have all the columns displayed but alphabetically using something that might be discovered from the schema where the columns are defined. Hope that makes sense.
Edit: The following statement sort of shows what I have in mind from the schema.
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'tablenamehere'
ORDER BY column_name
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
modified 24-Jun-13 6:23am.
|
|
|
|
|
PHS241 wrote: Is it possible to select this table's records and list them in column order animal, mineral, vegetable? No, unless you write a small macro that extends your IDE to do so.
PHS241 wrote: I have some tables that have an awful lot of columns How much is "awfull"? Are you sure the design is correct?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy, the table predates my time at the company. It's a financial type of table and has about 58 columns. I'm sure there are bigger tables out there in the world.
It would have been a nice to do if it was a quick shoot-from-the-hip statement clause but I can live with the existing ordinal position column order.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
I once wrote a script that went through the database and created views for each table sorting the columns alphabetically. I would then use the view when I needed the A suffix format.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I see your thinking. That's something to bear in mind as well.
I only really need this as I'm investigating some production problems that involve a number of tables and I don't think I'd be allowed to create anything new on the database.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
This will do the trick for one table.
Just build another cursor around this cursor to do it by table.
(my Jedi senses tell that I am going to get flamed by someone for suggesting a cursor)
DECLARE curs CURSOR FOR
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'yourTable'
ORDER BY column_name
declare @qry as nvarchar(max)
set @qry = 'select '
DECLARE @col nvarchar(max)
OPEN curs
FETCH NEXT FROM curs into @col
WHILE @@FETCH_STATUS = 0
BEGIN
set @qry += '['+@col + '],'
FETCH NEXT FROM curs into @col
END
CLOSE curs
DEALLOCATE curs
set @qry = substring(@qry,1,len(@qry)-1) + ' from yourTable'
exec(@qry)
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 24-Jun-13 9:46am.
|
|
|
|
|
In regards to using cursors, yes, they work... mostly. However, I've had issues in the past where they didn't work, so, as ugly as it is, I switched to WHILE loops... Ugly, but it worked consistenly.
Tim
|
|
|
|
|
You're right - here's the code for all tables using the while version:
set rowcount 1
declare @table as nvarchar(max)
declare @tbl_rowcount as int
declare @col_rowcount as int
declare @col nvarchar(max)
declare @qry as nvarchar(max)
select @table = table_name
from information_schema.tables
order by table_name
select @tbl_rowcount = @@rowcount
while (@tbl_rowcount != 0)
begin
set @qry = 'select ' + '''' + @table + '''' + ' as tableName, '
select @col = column_name
from information_schema.columns
where table_name = @table
order by column_name
select @col_rowcount = @@rowcount
while (@col_rowcount != 0)
begin
set @qry += '['+@col + '],'
select @col = column_name
from information_schema.columns
where table_name = @table
and column_name > @col
order by column_name
select @col_rowcount = @@rowcount
end
set @qry = substring(@qry,1,len(@qry)-1) + ' from ' + @table
set rowcount 0
exec(@qry)
set rowcount 1
select @table = table_name
from information_schema.tables
where table_name > @table
order by table_name
set @tbl_rowcount = @@rowcount
end
set rowcount 0
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
modified 25-Jun-13 11:37am.
|
|
|
|
|
Maybe you could build a stored procedure based on the following SQL which gives you the column names in alphabetical order:
Use [YourDatabase]
GO
SELECT SC.NAME FROM SYS.objects SO, SYS.columns SC
WHERE SO.TYPE = 'U' AND SO.name LIKE '[yourTableName]'
AND SO.object_id = SC.object_id
ORDER BY SC.name
You could use this to create a view or create a Dynamic SQL Statement where you pass in your "where clause".
Hope this helps.
|
|
|
|
|
Maybe I missed something in reading through the thread but I'll ask anyway. What RDBMS are you using?
If it is SQL Server (or probably most others) you can create a query that will generate a SELECT statement from the table and column information in the system tables (in SQL Server, sys.tables and sys.columns). Once that is generated (and a DECLAREd variable set to that varchar string, you can execute the r results.
|
|
|
|
|
Good morning, Ralph.
The database we use is SQL Server 2008. Is the idea you have in mind different to the other suggestions? If it is do you think you could paste an example for me/us?
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|
Th following could be implemented as a Sotred Procedure or simply executed as is in a query:
USE {enter your desired database name here};
DECLARE @NameOfTable VarChar(128);
SET @NameOfTable = '{enter your desired table name here}';
DECLARE @SQLStatement VarChar(8000);
SET @SQLStatement = 'SELECT ''' + @NameOfTable + ''' AS TableName';
PRINT @SQLStatement;
EXEC(@SQLStatement);
WITH TableColumns_CTE
AS
(
SELECT T.name AS TableName
,C.name AS ColumnName
,ROW_NUMBER() OVER (PARTITION BY T.name ORDER BY T.name, C.name) Seq
FROM sys.tables T
INNER JOIN sys.columns C
ON T.object_id = C.object_id
AND T.name = @NameOfTable
)
SELECT @SQLStatement = @SQLStatement + ', ' + ColumnName
FROM TableColumns_CTE;
SELECT @SQLStatement = @SQLStatement + ' FROM ' + @NameOfTable + ';';
PRINT @SQLStatement;
EXEC(@SQLStatement);
|
|
|
|
|
Ralph, thank you for that. I appreciate it and will try it at the office tomorrow.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.
|
|
|
|
|