Michael Crutcher

Ranch Hand
+ Follow
since Feb 18, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Michael Crutcher

I have a war file that I'd like to drop into various customer deployments. The war has several jsp's and a java bean that performs operations on a database backend and returns formated html for insertion in the jsp's.
Each customer has different database names, but the same table structure. I'd like the installation of the new war file to be as simple as possible. I'd like to use some sort of properties file that lists the various database names.
I don't know what the System.getProperty(user.dir) will return. Some jboss installations are started as services (thus making the user.dir the bin directory of jboss), some installations are started via a shortucut on the desktop (making the user.dir the desktop directory of whatever user clicked on the shortcut).
So I guess my requirements are this: I need a file that is easily editable to change the database names, I need to open this file through the java bean upon initialization to populate some values within the bean, and I need to make installation as painless as possible.
What would everyone suggest?
Thanks.
21 years ago
JSP
I don't think that there is any way to do what you're talking about in java. It would be possible to create a class that parsed the result set and returned an Arraylist of all of the columns and values. I think that would be pretty difficult and a waste of time. You've really got two options:
1. Create views; you won't get the performance benefit, but your pages will be able to be recreated with a minimal amount of editing (point at the view instead of the coldfusion temp table)
2. (Depending on the database you're using) Create derived tables. These tables will be actual tables that represent the subset of data that you wish to query. You'll get the performance boost but you'll also get a maintenance headache. The data won't be a real time representation of what's in the tables from which you derive the data. This might not be that big of a deal depending on how fresh your data needs to be. You could write an ETL process that refreshes the derived tables every night, or whatever your requirments need to be.
So views will be really simple, but will add some overhead over your current process (generally, some db's have support for materialized views). Derived tables will require an ETL process to keep fresh but will keep the same performance (or better) that you're used to.
Thanks for the suggestion, but I tried that:

I've also tried adding a default database option to the url.


It was probably pretty easy to miss because of the length of the original post.
I'm trying to connect to a sqlserver 2000 database. The database is on my microsoft network and I can correctly ping the machine by typing:

ping databasename


I'd like to connect to the database through microsoft's jdbc drivers. I'm using the sql server 2000 service pack drivers which can be found here.
These are the relevant lines of code:

I get this error back:

java.sql.SQLException: No suitable driver


I know that the classpath is setup correctly, because when run with verbose output enabled I can see the classes from the microsoft jars being loaded:

[Loaded com.microsoft.jdbc.base.BaseDriver]
[Loaded com.microsoft.jdbc.sqlserver.SQLServerDriver]
[Loaded com.microsoft.jdbc.extensions.ExtEmbeddedConnection]
[Loaded com.microsoft.jdbc.base.BaseConnection]
[Loaded com.microsoft.jdbc.sqlserver.SQLServerConnection]
etc.


I've tried various url's, both pointing at a local database and at remote databases. Because of this I don't think it's a network issue. I've also tried adding a default database option to the url.
I've tried compiling and running with jre 1.3.1 and jre 1.4.2, but I still get the error.
I'm stuck and confused, am I missing something obvious? I would greatly appreciate any help.
Thanks.
Just wanted to chime in and say that Dan is right. Your specific question is covered in detail in the book that Dan co-wrote. Go pick it up and support the authors :-)
You're right, I had a huge duh momement. The popupMenu was associated with the navigator view which I was using in the development environment, but the deployment environment had the package view (as opposed to the navigator view) open.
Man, that was embarassing.
Did you have a reaction to my other question (ant build stuff)?
Thanks,
Michael Crutcher
I'm having trouble getting some viewAction extensions to show up. This is the definition of the extensions (from plugin.xml):

The thing is that every thing works perfect when I run it as a run-time workbench (from the run menu), but after I rebuild the plugin and pop it into my deployment environment the pop-up view extensions do not show up. I'm completely stumped.
A couple more quick questions: what is everybody using to debug deployed plugins? Specifically does anybody lean towards log4j or java 1.4 logging.
Also, do you have to manually delete the jar that ant builds to get ant to rebuild any changes? If I don't delete the original jar and I've made changes ant does not rebuild the jar.
Any help is greatly appreciated,
Michael Crutcher
Some more info would probably let us give you much better suggestions.
What kind of work do you do? By that I mean guide us through a normal day at work for you. What takes you the most time? What tasks are repetitive?
Also, why the prejudice against IDEs? Without any additionaly information I would advise you to look at eclipse. Eclipse has a substantial number of user created plugins to automate many development tasks and new plugins are created every day.
Give me more info and I'll give you better suggestions :-)
Michael Crutcher
Texas A&M University
Dan:

Your point about views, could you elaborate a bit more? I'm not certain what you're after -- view to view synchronization? Eclipse doesn't have a generic solution, only a few specific cases (resource delta notifications, JDT element changes, etc). I assume this was because they wanted to avoid the "notify the world" trap that so many OO frameworks seem to fall into. What solution did you ultimately decide upon to solve your problem?


Here's a brief run down of what I was trying to do. I wrote a series of plugins that automate change management to a large scale database (teradata). Any change to any component of the ETL (extraction transformation load) process effects other components of the process. For example a change to a table name requires that all scripts that reference that table must also be changed.
So the plugins provide a view for source files, a view for scripts, and a view of databases. The source file view and script view are tied to the resource selection in the navigator view, and the database view has an action that allows you to specify a connection to a database. From these views users are able to interact with the components and make changes.
The last view is a changes view. It's a lot like the error log or task view, but contains a list of running changes that happen as a result of user actions. The changes are not directly tied to user action, as a user modification to a value might cause MANY rippling changes throughout the ETL process.
So what I want to know is what is the best way to access the underlying model of the change view from the inside the other views (so that when a user modification creates a set of changes the view can add the changes to the change view model).
I hope that wasn't too confusing. This is what I'm doing right now, and I think that there are probably a lot better ways to do it, but I can't find them.
Here's some code (off the top of my head, but I think its right)

The "lessthan" is because java ranch thinks they are html escape codes and keeps rejecting this post (wierd).
That seems like either a very involved way to get a view, or that I don't understand some fundamental concept. What I meant in my earlier criticism of the book is that I would have liked if there was some more background about how all the parts of the API fit together. There is some discussion of these issues, but I would have loved a chapter with a high level explanation of the major components of the API and how they all fit together. It would save me a lot of fumbling around reading the API trying to figure out what componets of the API I need to use.
Maybe not a fair criticism, as I'm doing some fairly involved things with Eclipse, but just something I was fighting with.
Michael Crutcher
Well the answer was correct, so I gave you credit :-)
I cross posted your response at http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20685356.html#8979083.
Read that thread to see why I hate experts-exchange at certain points. People are so crazy about getting points over there. It's like Lord of The Flies for Developers over there.
Thanks again,
Michael Crutcher
Thanks so much for the reply, I'll try it out when I get to work tommorow. I also asked this question on experts-exchange.com. Would you mind if I posted your reply to that thread (with proper credit, of course)?
Michael Crutcher
I posted this same message as an Amazon review. I hope it helps the authors sell some books, they deserve it.
Michael Crutcher
Texas A&M University
I bought the book several weeks ago and have read the book cover to cover and tried all of the excercises. I just wanted to let everyone know how good this book is. Seriously, I've purchased and read nearly a hundred technical books in the past several years and this one stands out as one of the best I've ever read.
Anybody who uses eclipse will get something out of this book, although as the title indicates it is primarily geared towards eclipse plugin developers. The first section is dedicated to eclipse users and illuminates many of the useful features that are built into eclipse. The second section of the book is where the real meat is at. This section covers everything you need to know to implement plugins. I was extremely impressed with just how much this book really covers. If you want your hand held for every step, this is not your book. It only presents code snippets, not fully coded examples for each concept. I think this is great, however, because the examples that are included (via the cd) do show full examples of the concepts without wasting valuable page real estate printing every last piece of code. Free of this baggage the book is able to cover considerable ground. If you want an idea of what this book is like go to eclipse.org and look at the articles. The book is like every article included on the website in much more detail, and covers many areas for which no articles have been written.
The SWT tutorial and the examples were also very good. I have a few minor nitpicks: the book was written for eclipse 2.0. Many of the wizard menus shown in the book have changed with version 2.1 (and again I'm sure with 3.0), but if you have some intelligence its not hard to figure out how to follow the examples in 2.1. Secondly I'd like a small section dedicated to getting information from existing views. I often need check information in one view in order to instantiate the model behind another view. The twists and turns of the extensive Eclipse API can make doing this not very intuitive. I've read the Resources section over and over, but I still haven't found the information I need. I eventually figured out some methods that worked after reading a lot of API documentation.
Those are just minor nitpicks, however. Overall I have to say this book is GREAT!! If your are an application builder (especially if you build tools), the power of the eclipse architecture will blow you away. I build tools for a data warehouse and eclipse has transformed my tools from quick-and-dirty tools designed for our specific needs, to near commercial ready plugins.
I can't stress this enough, Eclipse is a BIG deal. Its much more than an IDE. Do yourself a favor and buy this book, you won't regret it.
Michael Crutcher
Texas A&M University
[email protected]
I'm having a lot of trouble deploying a plugin that I have written for Eclipse. It works fine when running eclipse from my system, but when transfered to other systems I always get an error when I attempt to open the view that I've created. The error is a NoClassDef found error for the class SAXException. Seems simple enough, but the problem is that the systems that report an error when the view is opened are set to use the 1.4.2 JRE (checked through the setting found at window, preferences, java, jre). This version of the JRE includes the definition of SAXException.
I'm stumped, the class SAXException is in the source file provided by the JRE, but the plugin always reports that its not there.
Any suggestions?
Thanks,
Michael Crutcher
Texas A&M University
I've used just about any IDE you can think of (JBuilder, Eclipse, Intellij, Netbeans, Togethersoft, etc) and I still come back to eclipse. Don't get me wrong, Intellij is a great IDE, but I still prefer Eclipse. The newest version of Eclipse is very competitive with Intellij as far as refactoring support (although Intellij still has more refactoring options) but Eclipse is gaining on it with every version. Look at all of the new refactorings that were added from Eclipse 2.0 - 2.1. A beta of 3.0 is now out and includes additional refactoring support.
The thing that really keeps me away from Intellij right now is dual monitor support. I think that more than any other factor, dual monitors help me code faster. Intellij's support for dual monitors is non existant. You can drag windows around, but you can't have different editors opened on seperate monitors. Jetbrains says that this will be in the next version (or so they told me through email), but we'll have to see.
Anyway, I think that the only thing that Intellij has over Eclipse right now is a wider variety of refactorings, but Eclipse is closing the gap with each version. Eclipse has a far more active plugin community, and is free. Additionally if you really want a feature thats not in Eclipse you can just add it yourself. The other advantages of Intellij over Eclipse that have been mentioned are mostly bogus in my opinion. Eclipse's code completion is awesome, pretty close to Intellij's. Eclipse supports custom templates (lieve templates) as well. Although it doesn't come with as many by default (although it still has some sysout --> System.out.println() for example) you can set up any templates you like.
Pick what you like, but I think that everything that you can like about Intellij is (or will be soon) in Eclipse for free.
Michael Crutcher