| |
| |
| |
|
Page: 1 2 3
Comments:
<0> hi how does one p*** a named parameter to a callable statement <0> my statement looks like this: {? = call sp_add_job(?)} <0> to set the parameter i do: stmt.setString("job_name", "test"); <0> it throws an exception that job_name is not a parameter of sp_add_job <1> korbin: hmm, first time I've seen {} used in Java. <1> well, on their own that is :P <2> korbin stmt.setString(1, "test"); <2> first ? is 1, second is 2, etc <0> sabre: yes im trying to avoid ***igning an index to the parameter <0> i would rather set a parameter by name (which i guess is something new in 1.5) <0> i cant get it to work however. complains that the parameter is not defined for the stored procedure when in fact it is <2> must be something in your stored proc then <2> and yeah i wouldn't put those () around the ? <2> that looks fishy to me <2> SQLStmt.append("{ CALL SYSPROC.WSPST010(?,?,?,?,?) }"); <2> (working example) i'm out
<3> hey guys, logic question ..if you create an object and initialize it in one part of your application, what happens if you need access to this object and its data in another part of the app in another scope <3> p***ing it along through multiple objects to get it to the scope it might be used in the future seems kinda sloppy <1> depends how you defined it. <3> is there a better way to do this <1> you can always create an instance variable to use across methods. Or p*** it along, or... <3> private MyObj t1 = new MyObj(); // lets say thats defined in main() and you need to access it from one of the sub/sub/sub objects created in main() also <1> I doubt you'd define it like that in main() :P <3> umm ya <3> still, im having trouble figureout how to let my app communicate within each other once it starts getting bigger <0> some applications use a globally accessible directory object where you can store/lookup references to shared objects by id <1> \monster\: like I said; create an instance variable, for example. Or p*** it as a parameter or... <3> hmm i think singleton design pattern is what iv been looking for <4> hello, i specified the "windows xp" look-and-feel for my app but the controls look nothing like the familiar xp controls <4> the lnf did change but to something else <4> anybody know what might be wrong? <1> A little more context would be nice. For example; where did you specify it, what did you use, etc. <4> i called UIManager.setLookAndFeel() with the appropriate cl*** name. i tried both UIManager.getSystemLookAndFeelCl***Name() and "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" <4> both give me the same lnf <4> i specified it in the constructor of my cl*** that extends JPanel <4> err JFrame <4> sorry <1> hmm, setdefaultlookandfeeldecorated or something close enough. Afaik that will make the object completely decorated. <1> thats regarding to the JFrame ofcourse. <4> hmm i'll check it out, thanks <1> afaik (from mind, not sure) setting that will make sure that the JFrame 'blends in' with its environment and as such gets the standard look. <4> i just tried that, called it right before setLookAndFeel(), it produced the same result <4> a different lnf, definitely not xp <4> here's a screenie of the bottom of my window (two buttons and a combobox) http://nouser.pwp.blueyonder.co.uk/lnf.png <5> I'd have a question, there's a webapp that's a frontend to a jabber server instance behind <5> I'd like to extend it <5> in a way so that I'd expose some managers via JNDI <5> would that JNDI at that point be availible to the entire servlet/application container or would it be limited to the webapp itself? <5> specificly I'm using the wildfire server and it's web frontend deployed under JBoss <6> Evening all... <6> It seems like I cannot find a completely Java API for encoding/decoding. Does anyone here know of something like this? <1> oh; for the record.. Some time ago I was looking for a way to keep track of a connection duration. My approach was simply creating a long instance variable which got the current time in miliseconds (through the use of Calendar()) and at a later stage simply subtract this from the current time in miliseconds. Then calculate the miliseconds back to HH:MM:SS and done :) <1> Didn't want to bother looking for available Java methods so wrote up my own conversion routine, though DateFormat might be able to cope with this too. <7> hello how can I import a project written in Netbeans to Eclipse ? <5> Hi, can a webapp that lives in a application container publish a resource through jndi and if so would that resource be availible to another webapp? <8> I have objects of type Item in a vector orders, I'm want to put the value getQuantity(int) from the cl*** Item that is in the current postition of the vector, this doesnt work: qtyModel.add(i,(Item) (orders.get(i).getQuantity().toString())) <8> how should I do this <9> your cast is probably in the wrong place there <9> qtyModel.add(i, ((Item)orders).get(i).getQuantity().toString()); <9> looks better, to me <8> without the ) after orders right? <10> try seperating logic instead of doing it all on one line, it makes it much more readable <10> for you and other people <8> that's a type-o <9> no, with the bracket <9> er <9> wait <9> yes, it should be by the i) :) <9> that was a typo <8> :) <8> I did this : qtyModel.add(i, ((Item) (orders.get(i).getQuantity().toString()))) <8> still.. it accepts only methods of type Object <9> your bracket is still in the wrong place <9> you want to cast the result of orders.get to an Item <9> at the moemnt, you're trying to cast a String to an Item
<9> unless you're using a generic container, you'll need to make sure you cast the result of retriving an item from the container back to the underling type <9> s/underling/underlying <8> like this : qtyModel.add(i, ((Item) (orders.get(i)).getQuantity()).toString())); <8> ? <9> pretty much. But try what Deano said, split up your logic <9> then it will become clearer <9> cramming tonnes onto one line inevitably creates problems <8> still, this doesn't work, one way is to implement the toString() cl*** in the Item Cl*** , and just type order.get(i).toString(); , that will work, but I have already used my one toString method, <8> qtyModel.add(i, ((Item) (orders.get(i)).getQuantity()).toString())); , doesn't work <9> Well, what's the error? <8> "WelcomeFrame.java": cannot find symbol; symbol : method getQuanity(), location: cl*** java.lang.Object at line 255, column 61 <8> it always refers to the object cl*** <9> is getQuantity a method on Item? <8> yeah <8> but it looks in java.lang.Object as it says in the error message <8> I have an idea <9> qtyModel.add(i, ((Item)orders.get(i)).getQuantity().toString()); <9> should work fine <9> if it's not working, somethings wrong with your compiler. Split it up over multiple lines to see what <8> yeah :) <8> that works <8> typecasting is for magicians <8> thanks a lot <9> upgrade to 1.5, and do away with most casting :) <9> thanks to generic containers <11> and generic factories <8> well... I don't know exactly which one is used in JBuilder <8> 2005 <11> why are you using vector and not ArrayList? <11> symbol : method getQuanity(), <<< is this a typo? <8> hmm.. from the data structures without a fixed size I know vector,Linked List, Queue,Array and some combinations of these <8> that's why <8> I've heard that HashTables or hash something are pretty good, still... these (up) are the ones I know how do to use <11> ArrayList is the one you should use <11> hashtables are dictionaries so if you don't use keys you don't need one <8> I'll check em out <11> that is, base the choice between a vector and arraylist mainly on the grounds of thread safety <11> vector suffers perf issues as it's methods are syncronized i think <8> yeah I'm sure vector is less efficient (slower) and expensive(memory-wise) <11> plus, ArrayList implements List <12> hmm, is Vector worse than ArrayList on memory? <12> Oh yeah, it is <10> Vector is only left there for legacy reasons anyway, isn't it <12> if your list grows quickly, Vector *can* be faster in growing <12> ... ***uming you need a synchronized ArrayList :) <12> Deano|Wrk: yeah, pretty much <10> though so, ta <13> Often you need a better synchronization block than Vectors offers. Eg; allow multiple readers, but only one writer; or want to do more than one operation in the mutex <13> the util.concurrent stuff is actually really good <10> what do collections implement as far as sync. is concerned, LLyric? <10> (I could look it up if you're busy, just interested) <13> Deano|Wrk: nothing (except Vector), but you generally ADD synchronization etc <10> yeh I mean the default Collections.sync methods <8> (Item) orders.elementAt(i).quantity(); , I have trouble again calling a void method quantity, it's the same problem as before <13> Either in a simple way (Collections.synchronizedMap() iirc), by using a different implementation (multi-reader-hash-map iirc), or by explicitly adding business logic synchronization <13> Deano|Wrk: the default Collections.sync just wrap the call in a: synchronzied(collection) { collection.operation } <13> IIRC, but the code is there <10> yeh so I just saw from the javadocs <10> heh ok, something for me to read-up on further though, thanks. <13> Deano|Wrk: if you're doing concurrent stuff, have a read up on Doug Lea's concurrent stuff, added to JDK in 1.5 <10> well tbh I hardly touch upon concurrent problems/issues <13> It's really good. Things like mutex's and semaphors, and work-queues and consumers, etc. <13> As well as some nice collection implementations <10> thus my knowledge is very poor, not touched it much in a long time <10> I remember it from uni days/when I need to know it, but not as much as I should know. <8> is there something similar to StringBuilder in java 1.4.x ? <14> RickyL: StringBuffer ofcourse, if you can live with the synchronized behaviour <8> yeah.. I saw it.. not so good <8> how can I convert an int to a char <14> RickyL: What isn't so good about it?
Return to
#java or Go to some related
logs:
Hold_Me_Thrill_Me_Kiss_Me_Kill_Me.mp3 #london Unable to add forward map from XP bjeans Which is the farthest north, Helsinki, Oslo or Stockholm #linux #linux #linuxhelp #AllNiteCafe shitting torrents
|
|