What's the difference between CreateDynaset and dbCreateDynaset - OO4O and Wizards(Archived)

Does anyone know of the difference, if any, between using CreateDynaset and dbCreateDynaset? dbCreateDynaset seems to be largely undocumented so we would prefer to use CreateDynaset. 

There is no difference.
The 'db' starting all the commands is no longer used.
The commands are supposed to be identical.

Related

MYSQL Trigger java code

I want that the java code to be executed on mysql trigger? if it is possible please give an example of it.
not possible, afaik. not even desirable.
% 
if it is not possible please suggest some alternative ways. I want to make soap call from the java code when check constraints in the database fails.
Edited by: riddhi on 1 Apr, 2008 12:50 PM 
Why? 
I need it for an application. Please come up with some good answers. 
I need it for an application.Why do you need it?
Please come up with some good answers.After you. 
I have been looking for an answer to this question too. I will tell you why it would be helpful for me.
We have a database we run that is XML based. It has some distinct advantages, which is why we continue to use it, but is woeful with enforcing data integrity or data analysis functions that are easy with a relational database. Knowing that, I have written a program so that our XML database now has a MySQL counterpart. Whenever we modify a record in the XML database, the changes update the MySQL db using Java classes. So finally we have a way to do select statements and data analysis on the MySQL side. The problem is, when we identify problems, we have to go back to the XML database and make changes record by record. Let's say 80 records are found that have a null value when they should have "Book" in the field. We have to go to the XML database and enter "Book" 80 times for each record. What I would like to do is be able to enter the changes directly in MySQL Query Analyzer and have the changes update our XML database. To do this I need to know how to call Java when we make a database modification in MySQL.
Is this possible?
Edited by: grantarchy on Apr 23, 2008 11:19 AM 
grantarchy wrote:
I have been looking for an answer to this question too. I will tell you why it would be helpful for me.
We have a database we run that is XML based. No. You have an XML file. You do not have a database.
It has some distinct advantages, which is why we continue to use it, but is woeful with enforcing data integrity or data analysis functions that are easy with a relational database. Indeed.
I am not bothering to continue reading this post.
XML is not a database. This has been discussed time and again. Whatever problems you are having are stemming from the poor decision that needs to be addressed. Continuing to patch, kludge and hack stuff together is an absolutely rubbish solution.
And that's all she wrote on that one. 
Wow, this has got to be one of the most intellectually arrogant forums that I've ever read or posted to. I'm well aware of what XML is, and our data management system is not "an xml file". Instead of copping a "you're too stupid for me to bother with" attitude, maybe you could offer a constructive response, or better yet don't even bother responding in the first place. People were rude to the poster of the original question, and now to me too. I see in your profile that you call yourself "Super Genius" - I guess I shouldn't be surprised. The ironic thing is that you really didn't understand the question - you just figure that since I mention xml and database in the same sentence that I must think an xml file is a database. 
grantarchy wrote:
Wow, this has got to be one of the most intellectually arrogant forums that I've ever read or posted to. Certainly possible that is your experience. Certainly this site has less problems by far compared to others. One newsgroup used to have one of the authors of the language regularly flame obvious and admitted newbies.
I'm well aware of what XML is, and our data management system is not "an xml file". Instead of copping a "you're too stupid for me to bother with" attitude, maybe you could offer a constructive response, or better yet don't even bother responding in the first place. A constructive response is in fact to consider refactoring to use a database.
And your current described solution is in fact very bizarre.
Given that the complexity level is growing (the need that spawned this question) have you sized using the growth to determine if the current system might fail at some point in the future either due to complexity or performance?
People were rude to the poster of the original question, and now to me too. I see in your profile that you call yourself "Super Genius" - I guess I shouldn't be surprised. The ironic thing is that you really didn't understand the question - you just figure that since I mention xml and database in the same sentence that I must think an xml file is a database.Myself I understand that having a trigger do anything outside the database is often a sure sign that something is wrong.
I might also wonder why you can't use something like XSLT to apply your data validation rules? Then it wouldn't be broken in the first place.
Or simply extract the entire database at a periodic basis to rebuild your xml base? That would allow you to create more reasonable check points.
If you must do this then normally, in something besides MySQL, triggers can invoke processes outside the database itself. So questions that you might answer if you want this.
1. Can MySQL invoke outside processes in a stored proc?
2. Can it do so in a trigger? If 1 isn't true then this won't be either.
Normally if you could do 2 above then you would need to set up a server to receive the request and process it.
MySQL can not invoke java in process versus say Oracle which can. So if that is your sole question you have your answer. 
jschell wrote:
Certainly possible that is your experience. Certainly this site has less problems by far compared to others.Thank you for your response. I should probably not judge the entire forum based on the comments of one super genius.
A constructive response is in fact to consider refactoring to use a database.This is possible, probably inevitable, and one reason I am testing out a MySQL version. I have come to accept that we need to move to true database system, but we use some specialized modules that are specific to our industry that are integrated into the existing application. There will be some time involved to program those modules into a new system.
>
And your current described solution is in fact very bizarre.No arguments here.
Given that the complexity level is growing (the need that spawned this question) have you sized using the growth to determine if the current system might fail at some point in the future either due to complexity or performance?Performance wise we are OK and are not even close to hitting the limit, but the growing complexity of the types of data we catalog is definitely heading us towards an unpleasant place.
>
Myself I understand that having a trigger do anything outside the database is often a sure sign that something is wrong.I don't know if that is always true, but in this case it certainly is. This is really not intended to be a long term solution. I just recently even got the data into MySQL to where we could do some data analysis. This question was to see if I could devise a solution to quickly modify batches of data where we've identified some issues while still working towards a long-term solution.
I might also wonder why you can't use something like XSLT to apply your data validation rules? Then it wouldn't be broken in the first place.This is something I will look into. I haven't used xslt for data validation before so it hadn't occurred to me that I might be able to do something with that.
Or simply extract the entire database at a periodic basis to rebuild your xml base? That would allow you to create more reasonable check points.
If you must do this then normally, in something besides MySQL, triggers can invoke processes outside the database itself. So questions that you might answer if you want this.
1. Can MySQL invoke outside processes in a stored proc?
2. Can it do so in a trigger? If 1 isn't true then this won't be either.
Normally if you could do 2 above then you would need to set up a server to receive the request and process it.
MySQL can not invoke java in process versus say Oracle which can. So if that is your sole question you have your answer.And I think that is the answer. I work for a small non-profit with limited IT resources so there is virtually no-one to consult for the vast majority of these kinds of issues, thus my posting here to attempt to get either an answer to this question or another perspective. Thanks for providing both. 
As a follow-up, a post in another forum did provide a way to call a user defined function from MySQL:
http://www.mysqludf.org/lib_mysqludf_sys/index.php
Not a secure way of doing things, but if you're desperate ... 
grantarchy wrote:
As a follow-up, a post in another forum did provide a way to call a user defined function from MySQL:
http://www.mysqludf.org/lib_mysqludf_sys/index.php
Not a secure way of doing things, but if you're desperate ...I don't think I would say that is a "user defined function".
Some databases allow you to add in actual code. MS SQL Server does that with CLR (adding in .Net code.) Oracle allows that with embedded java. At least in the past I thought one of those allowed a way to add C code (which is probably a really good way to also add problems.) And of those might be termed a user defined function.
Conversely many database allow you to invoke external processes. Which would be what that is doing.
So in your case you could write an app that would send a command to a server. And then call it from your code. At least in terms of protocol you can add security by adding a secure transport mechanism if that is a concern. That could probably provide a solution but a rather complex one.
If it was me I might do the following.
1. Have the trigger(s) post to a task table(s).
2. Set up a server. The server polls the task table and processes any tasks found. The server can be written in java.
In the above the complexity of what a 'task' is defined by you. 
jschell wrote:
grantarchy wrote:
Wow, this has got to be one of the most intellectually arrogant forums that I've ever read or posted to. Certainly possible that is your experience. Certainly this site has less problems by far compared to others. One newsgroup used to have one of the authors of the language regularly flame obvious and admitted newbies....which of course never happens here
I'm well aware of what XML is, and our data management system is not "an xml file". Instead of copping a "you're too stupid for me to bother with" attitude, maybe you could offer a constructive response, or better yet don't even bother responding in the first place. there are a few here that can't stick to logic and insist on interjecting their opinions on how you should be coding your apphere you - you just have to ignore it
A constructive response is in fact to consider refactoring to use a database.
And your current described solution is in fact very bizarre....even though many people have asked to do this many times here. it's not bizarre. rare? yes. but just probably not well-conceived workflow/process
Given that the complexity level is growing (the need that spawned this question) have you sized using the growth to determine if the current system might fail at some point in the future either due to complexity or performance?
People were rude to the poster of the original question, and now to me too. I see in your profile that you call yourself "Super Genius" - I guess I shouldn't be surprised. The ironic thing is that you really didn't understand the question - you just figure that since I mention xml and database in the same sentence that I must think an xml file is a database.Myself I understand that having a trigger do anything outside the database is often a sure sign that something is wrong.agree 100%
I might also wonder why you can't use something like XSLT to apply your data validation rules? Then it wouldn't be broken in the first place.
Or simply extract the entire database at a periodic basis to rebuild your xml base? That would allow you to create more reasonable check points.
If you must do this then normally, in something besides MySQL, triggers can invoke processes outside the database itself. So questions that you might answer if you want this.
1. Can MySQL invoke outside processes in a stored proc?
2. Can it do so in a trigger? If 1 isn't true then this won't be either.
Normally if you could do 2 above then you would need to set up a server to receive the request and process it.
MySQL can not invoke java in process versus say Oracle which can. So if that is your sole question you have your answer.Right, unless OP wants to poll the db (yuck! even worse) 
there are a few here that can't stick to logic and insist on interjecting their opinions on how you should be coding your apphere you - you just have to ignore itFunny, but it seems like the exchange between jschell and the OP is not only civil, but constructive. You're the one throwing gasoline on the fire. Makes sense, because as usual that's all you have to offer in the discussion. There's never been an individual who posted so persistently with so little to contribute as you. Most people this ignorant give up after a few posts. Kudos to you for being a persistent fool, wpafbuser1.
%

Wierd .NET IDE debugging behavior after installing ODP 10g

We are experiencing some wierd debugging behavior. What happens is that, during debugging with VS 2003, the debugger seems to 'skip' statements that are associated with database operations. For instance, I can be single-stepping through a VB.NET program, and once I hit a DB related statement (such as setting command parameters, executing a data reader, etc) the debugger will simply 'skip' ahead a number of statements (if not all the way to the end unless a breakpoint has been assigned before this). The code it 'skips' actually runs - it just no longer single-steps through it. This only occurs with DB related statements, and it is NOT consistant (i.e. some statements it single steps through fine, others it exhibit this skipping issue). I know it is not my machine because others in our group have experienced the same thing.
We recently switched to the Oracle 10g ODP client (from the 9i client), and that is when this wierd issue began. So that is why I am thinking this may be an ODP issue,. Any ideas? Thanks in advance.
Tom 
Hi,
My memory is getting foggy in my old age, but I've seen this behavior in the past. I think I removed the reference to the ODP.NET assembly from the project, added a reference to the new assembly, recompiled, and that fixed it. As I say, not 100% certain, but that seems familiar anyway.
- Mark 
Mark:
Hmm... tried this but it didn't seem to help. Very wierd... anyway, if you have another brainstorm please let me know. Grasping at straws here...
Tom

Max performance with J2EE

Hi All, First, I'm not sure if this is the right forum where to post my question, anyways, thanks in advanced for the help: We have an old and very heavy loaded application where we run thousands of statistical algorithms, each algorithm in turn is composed of four sub-algorithms, each subalgorithm represents at least one DB query. Currently this queries are executed with JDBC: As you can imagine, our DB gets very stressed and the performance is poor. We have to re-engineer our application and our objective is to make it run at least ten times faster, and we are planning to: -Run the application in a grid with Terracotta -Use Spring as our container -Run the sub-algorithms in pararallel with the Java 5 concurrency -Replace JDBC with a DAO -Implement the DAO with IBatis -Use Ehchache or OSCache -It's imortatnt to mention that the DB Admins will never allow us to use strored procedures. We are beginning our analisys, and we are open to use the technologies in the DAO and just the DAO that will boost our app, please let us know the technologies, frameworks (TimesTen?) and more that can help us to get the max performance in our DBs I/O. Thanks a lot!
At first blush, nothing you describe inherently implies bad performance,
and not much you propose implies better performance.
What DBMS are you currently using? Is the application that does the
JDBC a long-running one, or do users run it over and over, each run
starting and completing a JVM run, and delivering only one result?
Is there any middleware involved, or do users directly start and stop
their own instance of the application, which talk directly to the DBMS? 
We use Oracle10g, and yes, for each value needed a JDBC statement is executed.
There's no middleware involved, just dozens of:
stmt = _conn.createStatement();
rs = _stmt.executeQuery(sql);
all over the place.
That's why we want to use a cache and something else that could help us improve performance.
Thanks. 
Hi
You provide very generic information... so, here my feeling while reading your posts...
It doesn't matter what technologies/frameworks you want to use. The techniques implemented with them are central. Therefore, you have to carefully design the new system to meet the requirements...
Two techniques seams central. First, go away from single-row processing; i.e. process data in batches as much as possible. Second, parallelize the single tasks. Note that doing the latter without the former makes no sense.
You are thinking to a cache... Let me state the obvious, a cache is only useful if you are reading several times the same data. If it is the case, IMHO, you have to think out it. Why it is that way? Eventually something wrong is going on.
If I were you I would carefully analyze the current situation, find out what the real bottleneck is and how to move it somewhere else.
HTH
Chris 
Hi,
Just my 2 cents...
Looks like you are not using PreparedStatements? If you don't use prepared statements, depending on the SQL you are submitting, your db will get hammered by hard parses. In addition to hard parses, your application simply will not scale.
I would recommend you tune your SQL and use prepared statements first. You might be very surprised at your performance improment.
Otherwise, you could look into setting the init parameter CURSOR_SHARING. That lone parameter could greatly improve your performance, but there are side effects so beware.

Database Parameters

Guys, No doubt I will be posting on here for a few weeks to come, I am due to start a Java Web Service SOAP project and its been a little while since I touched Java, so will no doubt take me a bit to get into it. Anyway my first question is around connecting to the database etc and writing stuff to it. Normally I would just do this with straight forward SQL tables etc, I know in .net there is datatables etc, is such a thing avaliable in Java? Is it still considered best practise just to write sql statements then execute them etc, i guess I am asking what is the best 'most recent' method of Java writing to a database - or can you point me in the way of a tutorial? Also, in .net there is the app.config file to store session variables like db username and passwords and SIDS, again is there such a tool in Java, or do I have to write an xml file of my own etc, again any advice or tutorial would really be appreciated. Is there a book that mite be useful as a reference guide to some of this stuff? I know there is loads of Java books out there, but its making sure I get the right one. Thanks guys!
Google for hibernate. 
liquidchild wrote:
Guys,
No doubt I will be posting on here for a few weeks to come, I am due to start a Java Web Service SOAP project and its been a little while since I touched Java, so will no doubt take me a bit to get into it.My only advice here would be to avoid Axis at all costs.
Anyway my first question is around connecting to the database etc and writing stuff to it. Normally I would just do this with straight forward SQL tables etc, I know in .net there is datatables etc, is such a thing avaliable in Java? I'm not that familiar with .Net
Is it still considered best practise just to write sql statements then execute them etc, There's no such thing as "best practice". I personally prefer a good DAO implementation with SQL statements using JDBC for most tasks.
i guess I am asking what is the best 'most recent' method of Java writing to a database - or can you point me in the way of a tutorial?JDBC
Also, in .net there is the app.config file to store session variables like db username and passwords and SIDS, again is there such a tool in Java, or do I have to write an xml file of my own etc, again any advice or tutorial would really be appreciated.You can use JNDI, Servlet context stuff, the database, properties files, whatever.
Is there a book that mite be useful as a reference guide to some of this stuff? I know there is loads of Java books out there, but its making sure I get the right one.For reference, Google is my personal favorite.
I'd also like to add that I do not recommend Hibernate.
I also highly recommend avoiding any frameworks outside of J2SE/J2EE unless you really need them. 
liquidchild wrote:
Anyway my first question is around connecting to the database etc and writing stuff to it. Normally I would just do this with straight forward SQL tables etc, I know in .net there is datatables etc, is such a thing avaliable in Java? Is it still considered best practise just to write sql statements then execute them etc, i guess I am asking what is the best 'most recent' method of Java writing to a database - or can you point me in the way of a tutorial?Are you going to be writing thousands of SQL statements against thousands of tables?
Or two queries against two tables.
If the second then myself I would use JDBC unless I wanted to learn something like hibernate (and I had the time.)
If the first I would definitely look for some solution that does not involve manually creating JDBC. And hibernate is one popular solution that allows that. 
I'd also like to add that I do not recommend Hibernate.
I also highly recommend avoiding any frameworks outside of J2SE/J2EE unless you really need them. Hibernate contains a full JPA implementation which is a Sun standard.
It is therefore quite suitable for use.
And why do you recommend people reinvent the wheel every time they code something?
While overuse of frameworks is a communicable disease among programming teams, total celibacy isn't the answer.
There must be a golden middle road, which is figuring out whether something is appropriate for the scenario at hand and using it only if it really is. 
SoulTech2012 wrote:
I'd also like to add that I do not recommend Hibernate.No one said you had to, but could you give a valid reason why not? (Not just "because I don't like it" or "because I don't feel it's necessary".)
As for a valid reason why he should use it (in case you want to ask), is because it does exactly what the OP was asking for. 
Guys,
Thanks for the responses.
It wouldn't be a lot of sql, we would get a request coming in and would write to one or two tables, after extracting some data from another five tables.
So not that SQL heavy.
Does this mean that perhaps Hibernate is overkill for what I require? 
Yes, Hibernate is overkill for your needs.
Even if you had a lot of sql to write in future projects, I suggest you master JDBC
before considering an advanced topic such as hibernate. 
jwenting wrote:
I'd also like to add that I do not recommend Hibernate.
I also highly recommend avoiding any frameworks outside of J2SE/J2EE unless you really need them. Hibernate contains a full JPA implementation which is a Sun standard.
It is therefore quite suitable for use.There are lots of standards in the world. That's not a reason to use it.
And why do you recommend people reinvent the wheel every time they code something?I don't recall doing that.
While overuse of frameworks is a communicable disease among programming teams, total celibacy isn't the answer.I never said it was.
There must be a golden middle road, which is figuring out whether something is appropriate for the scenario at hand and using it only if it really is.Which is exactly what I said. 
masijade. wrote:
SoulTech2012 wrote:
I'd also like to add that I do not recommend Hibernate.No one said you had to, but could you give a valid reason why not? (Not just "because I don't like it" or "because I don't feel it's necessary".)I never said I didn't like it or that I felt it wasn't necessary. I said that I don't recommend it, which implies that I feel there are better solutions out there. Whether or not it's necessary is not up to me, but I think we've already seen that OP's project doesn't require any framework here, Hibernate or otherwise.
As for a valid reason why he should use it (in case you want to ask), is because it does exactly what the OP was asking for.It may "claim" to do what you think OP needs, but that doesn't mean it's the right thing to do. There are lots of ways to skin a cat, and depending on what you're doing, you'll find a lot of tools that appear right for the job. For example, my local diner and McDonalds both have the item "Cheeseburger" on the menu. I've tried both and choose not to go to McDonalds. It's not necessary, as I could probably tolerate or even live on McDonald's cheeseburgers, but I don't recommend them. 
SoulTech2012 wrote:
I said that I don't recommend it, which implies that I feel there are better solutions out there. Such as?
>
As for a valid reason why he should use it (in case you want to ask), is because it does exactly what the OP was asking for.It may "claim" to do what you think OP needs, but that doesn't mean it's the right thing to do. There are lots of ways to skin a cat, and depending on what you're doing, you'll find a lot of tools that appear right for the job. For example, my local diner and McDonalds both have the item "Cheeseburger" on the menu. I've tried both and choose not to go to McDonalds. It's not necessary, as I could probably tolerate or even live on McDonald's cheeseburgers, but I don't recommend them.Perhaps but that still doesn't provide a reason.
For example a reason not to go to McDs is because you like thick burgers. Or because you like sourdough buns. Those are individual preferences.
You might prefer the diner because the price is cheaper. That would be a more objective criteria than the other two. 
Fine, sigh....here are 10 reasons I don't like it:
1. yet another thing to download
2. yet another thing to install
3. yet another thing to configure
4. yet another thing to learn
5. it bloats the codebase
6. it slows performance
7. i don't like programming in XML
8. it's not compiled code against an API, so if you have a typo in your XML you won't know until runtime
9. when you have errors in the XML, it will produce some hibernate error you've never heard of and you can't figure out what it is because...
10. poor documentation
want me to keep going? 
SoulTech2012 wrote:
Fine, sigh....here are 10 reasons I don't like it:
1. yet another thing to download
2. yet another thing to install
3. yet another thing to configure
4. yet another thing to learn
5. it bloats the codebase
6. it slows performance
7. i don't like programming in XML
8. it's not compiled code against an API, so if you have a typo in your XML you won't know until runtime
9. when you have errors in the XML, it will produce some hibernate error you've never heard of and you can't figure out what it is because...
10. poor documentation
want me to keep going?Nope. Those are all reasons. To me 8 and 10 would seem most relevant.
What are the alternatives? 
What are the alternatives?Writing your own using [Commons BeanUtils|http://commons.apache.org/beanutils/]
Edited by: SoulTech2012 on Oct 2, 2008 3:25 PM 
SoulTech2012 wrote:
What are the alternatives?Writing your own using [Commons BeanUtils|http://commons.apache.org/beanutils/]No idea how that library helps.
Other than that of course rolling your own is always a solution. Just as, for example, one might choose to writes ones own J2EE container.
Myself I am not sure that choosing to do that is always the best choice however.

How to disable derby for WebLogic 12.1.2?

Previous versions of WebLogic did not automatically start the Derby database but now with 12.1.2 it is always starting it. This is happening all the time, no matter if this is a production domain or not. What is the reason behind this change of behaviour and what is the easiest way to disable that in a domain template without modifying multiple files?
Basically there is a simple IF statement in the "$WL_DOMAIN_HOME$\bin\setDomainEnv.cmd" file: #REM Set DERBY_FLAG, if derby is available. if exist %WL_HOME%\common\derby\lib\derby.jar (    set DERBY_FLAG=true) So if you want to prevent derby form starting you have a couple of options:you can rename "derby.jar" to something else (this is what I have done and it works)you can delete the IF statement from start-up scriptmaybe you could statically set the DERBY_FLAG to false in the startWeblogic.cmd script... How to set this particular feature in a template I don't know. I hope this at least partially solves your problem. Regards, Goran
Thanks,I guess it is back to tweaking CLASSPATH, system variables and batch files, just like good early days of Java.I expect thousands questions like that following seemingly "minor" (12.1.2) update of distribution package. I hope someone can figure out how to disable particular feature in distribution DURING installation process  Cheers,Andriy
There's another way: pass the parameter "noderby" when using the script startWeblogic.cmd. Regards,Amit.
Setting the derby flag to false as suggested in 3 bullet point above seemed to work too.  Question is, why would Oracle bundle it this way for production installs? 

Categories

Resources