nico dotti

Ranch Hand
+ Follow
since Oct 09, 2007
Merit badge: grant badges
For More
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 nico dotti

I'm a pretty die-hard vi[m] user and I've just found a tool that apparently makes calls on eclipse to get some of the functionality into vim (autocompletion, validation, etc.). My concern before biting the bullet and spending an hour or two setting this up, is if it's mature and doesn't get bogged down by making calls to eclipse (I can just open up eclipse if I want to wait around) Here's the url for the tool I'm speaking of:

Otherwise, I'll probably set up a java keyword dictionary for vim.

[ March 02, 2008: Message edited by: nico dotti ]
[ March 02, 2008: Message edited by: nico dotti ]
Well thanks for your input. I would have loved for there to be something in the PreparedStatement API to do setEmpty or setNone but of course that would be making it too easy. They do have setNull which has come in handy but doesn't help me here because then it would just look for NULLs.
Sorry, I won't use those abbreviations anymore. Also, thank you for giving my question your time.

I deeply apologize if I'm just being an idiot, but feel as though I must not be making myself clear on my goal because in order to do this the way I believe you're suggesting I WOULD have to do it dynamically (if I follow your suggestion of only using fields that the user actually chooses to search by to improve efficiency).

Just so we're on the same page and you understand what I'm after, please look at the advanced google search form here:

Notice that the user can input whatever fields they want (one, a few, many, all, it doesn't matter to in respect to what google is requiring of the user). So I have something similar where I have about a dozen fields and I don't want to restrict the user on which combinations of fields they use.

As far as I know, I have to provide the column names and the values can be dynamic using the IN parameters like: name=?, age=?, etc., but I can't do: ?=?, ?=?. I'm correct on this aren't I? This is from looking at several examples and having always done it this way myself. However, if I'm wrong and there's an easy way to do this that would be great.

So given my problem statement how would I deal with the multiple combinations of 'chosen' fields by the user without doing this dynamically? (You mentioned in your last reply that I wouldn't need to do this dynamically so that's why I ask).

So for example with only three fields WITHOUT doing it dynamically I'm conceiving that I'd have to go through this mess:

So for 10 fields it's going to get ridiculous unless I do it dynamically, or use my first idea of having one PreparedStatement and setting empty fields to '%' so I could just do:
col1=? AND col2=? AND col3=?.

However, I agree with you that this would not be the most efficient way, so I am quite keen to find another solution. I have already done a lot of dynamic building of sql so it doesn't bother me to do so if I have to but I'm just wondering if there's a better way before I commit to that solution. Thanks for your time and again I apologize again if I'm not getting what you're trying to convey to me, but I still don't quite have the answer I'm looking for and I'm going to start coding this tomorrow.
So would I have to dynamically build the WHERE clause depending on the user choices for search fields? Given that I have about a dozen fields that match up to columns that would be a lot of combinations if I don't do it dynamically. LMK what approach you're suggesting. Thanks.
Hello ranchers. I have created an application that logs incidents to a database. I now need to provide the user with an advanced search form for searching these incidents by many optional fields. I'd like to implement something that looks similar to google's advanced search form where the user can search by any number of optional parameters. My solution is to create a prepared statement and set any non-selected fields (which will denote that they don't care about this so I should somehow say ANY of these fields) to the sql wildcard value of '%'. This way I can use one prepared statement for any possible combination of the fields the user elects to search by. So for example if I narrow down to two fields (there will actually be many more):

either way it doesn't matter and the same prepared statement can handle both. My Question: Is this the best approach or is it just a hack? This seems to be a boiler plate feature so I'd like to hear from others that have tackled this. Thanks!
[ February 28, 2008: Message edited by: nico dotti ]
I apologize in advance as this is more of an ActionScript question for Tomcat.
Does anyone know if there is a standard way to configure actionscript packages in Tomcat 6? Directory structure and config files? Thanks all.
16 years ago
Dope! That's right...thanks!
Hello all, I've noticed that a lot of the Generics stuff that I learned to pass the test a few months back has somehow vanished from my mind! Now I'm needing to use this in a real-world application so I'll pose this as a question: I have a dynamic sql building class that 'has a' Hashmap to keep track of columns and values for a potential insert statement (ie (col1) VALUES (value1). Put differently, it is availabe for appending more and more col/values in building an insert statement.

So my question is how to convert my Hashmap declaration into a generic that can take String for key and Object or any subclass of Object for the value. Here's the non-generic declaration as it now stands:

When declaring my member Map, I need something like Map<String> map = new HashMap<Object>() that will allow for only Strings as keys, and Object or subclasses for values. Is what I just mentioned the correct way to do this? My method that gets these values is simply: public void appendColVals (String columnName, Object Value) and in it's body it 'puts' these into the map.

Thanks all for the help.
I just did some more testing and noticed I can definitely toggle SEVERE, WARNING, and INFO levels but no lower. Something else is obviously kicking in and preventing this. I have a complex env with flex2 stuff too, and I think that the commons-logging is possibly screwing me up in this area? I've been searching and hacking and searching and hacking some more - hopefully I'll figure this out otherwise I'll be stuck with only the three levels
16 years ago
Thanks but I think that's what I've already been trying (see sample code in my last post). Did you put this in your project's WEB-INF/classes directory?
Did you have to edit any other files?

For clarity here's what I have in my project's

[ February 03, 2008: Message edited by: nico dotti ]
16 years ago
I'm so close to getting everything I need from metadata to dynamically create a build.sql scxript, but I don't see a way to get UNIQUE constraints (not PK's or FK's though they should be unique I actually mean UNIQUE sql constraint). Looking for something like:


Any suggestion? Thanks all.
Hi all, I'm pulling my hair out trying to get tomcat logging levels to work. If you're a Tomcat logging guru, please please help! I'm trying to use the java.util.logging as that's fine for my needs and don't want to switch to log4j if at all possible. Thanks in advanced! Here's my issue:

I have custom logging going by putting a file in WEB-INF/classes per the tomcat logging reference docs. I get the custom logs that look like so: dispatch2008-01-31.log. However, when I try to lower the levels of logging I can't seem to get it below Level.INFO logging. HELP!

I haven't checked my jdk logging properties because that would defeat the whole purpose of being able to use log levels dynamically via Tomcat's JULI implementation. I know that it defaults to INFO level so I'm assuming that JULI may not be overriding that level of logging? But the docs say it does?
Apache Logging Reference for Tomcat 6
I've even tried deleting the my app's and hacking the tomcat/conf/ Even tried setting every damn entry to ALL! No dice. Here's an example of one stab at as I had it in my WEB-INF/classes dir:

Here's both files:


and here's the one I have in myapp_root/WEB-INF/classes:

When I try this:

Only the INFO gets logged! Ergh!!! I'm on linux:
Linux toshiba 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux using Kubuntu Gutsy (latest)
16 years ago
So are you saying that the only things I need to close up are connections, statements, within my classes then right? What exactly does one use the contextDestroyed for then?
16 years ago
I'm using a DataSource to allow for pooling MySQL5 connection via Tomcat 6. I have a ServletContextListener and I'm wondering what the standard way of dealing with 'cleanup' is. Here's what I have as a first attempt. Suggestion? Thanks all:

[ January 24, 2008: Message edited by: nico dotti ]

[ January 24, 2008: Message edited by: nico dotti ]
[ January 24, 2008: Message edited by: nico dotti ]
16 years ago