3,892 Posted Topics

Member Avatar for pnelsonsr

First advice; avoid the "big re-write". The worst thing you could possibly do would be try to phase out everything and struggle when something stops working. No matter what datastore you are accessing, using the DAO pattern should help you isolate the database/datastore specific logic to a fixed set of …

Member Avatar for ~s.o.s~
0
78
Member Avatar for rahulrulez

[quote]Not true if you want to keep your files in top level, meaning classes folder. At that time you do not need package declarations.[/quote] ...which unfortunately is a really bad idea in case anyone reading this thread thinks that it would be a convenient one. As of Java 1.4, unnamed …

Member Avatar for nohup
0
2K
Member Avatar for Dani

Unfortunately no. The simple reason being that for me a news aggregator site like reddit/digg/hackernews does a far better job at presenting <insert-your-interest-here> news story than a single site. Plus most of the news stories here are more "tech" oriented (gadgets, gizmos etc.) than being "developer" oriented (a new programming …

Member Avatar for Ancient Dragon
0
662
Member Avatar for daudiam

[quote]Even if I remove the package declaration from B.java[/quote] Then B becomes part of the unnamed namespace and types belonging to the unnamed namespace are invisible to namespaced types starting Java 1.4 since there is no mechanism wherein you can import those. Your example should work if you also move …

Member Avatar for ~s.o.s~
0
212
Member Avatar for Abdel_eid

> so please i want to know where i can start learning jsp and servlets The Java EE tutorial is a solid starting point. Also, reading the stickies at the top of this forum should be helpful at this point. A few other resources: [LIST] [*][URL="http://books.coreservlets.com/"]Core servlets series by Marty …

Member Avatar for madhub2v
0
145
Member Avatar for ismithx

[quote]Well, i saw these two already, but i was hoping to get, like a beginner's tutorial explaining it step by step.[/quote] I don't think you would find anything more basic than the "Getting started" stuff offered by the Sun L&F docs. For how long have you been programming in Java? …

Member Avatar for ismithx
0
264
Member Avatar for jack223

LOoks like your concept of array indexing is a bit shaky. If the array is declared as int binary[10], it contains 10 elements which can be accessed using binary[0] to binary[9]. If you use binary[10] you would be handling memory which doest belong to you and its called out of …

Member Avatar for harunosakura
0
1K
Member Avatar for Duki

Apart from those already mentioned, I miss a few other posters from the C/C++ forums: [LIST] [*][URL="http://www.daniweb.com/forums/member136602.html"]ravalon [/URL] [*][URL="http://www.daniweb.com/forums/member112304.html"]Inanna [/URL] [Narue? ;-)] [/LIST] Come to think of it, the Java forum is in serious need of some awesome programmers like the ones mentioned in this thread. :-)

Member Avatar for ~s.o.s~
0
172
Member Avatar for TheWhite

[URL="http://stackoverflow.com/questions/3590000/thread-interrupt-what-does-it-do"]Recommended reading[/URL]; post again if you get stuck with implementation. Also do have a look at the links mentioned in the comments there.

Member Avatar for ~s.o.s~
0
155
Member Avatar for TahoeSands

@Override ensures that you don't end up *supposedly* overriding a super-class method and wondering why it doesn't work. E.g. every object inherits a toString() method from the Object class. A small typo in your toString() implementation might leave you scratching your head as to why your toString is not being …

Member Avatar for NormR1
0
423
Member Avatar for tactfulsaint

Another attempt at writing the entire logic in JSP? Anyways the message is pretty self explanatory; the JSP engine was unable to compile the JSP to a Servlet due to compile time errors. J2EE tutorial 1.5 / 1.4 along with a good book might do a lot more good than …

Member Avatar for ranu26
0
146
Member Avatar for Nick Evan
Member Avatar for Dean_Grobler

The servlet container creates a single instance of the servlet and reuses the same for every request. This has the implication that your instance variables in your Servlet would be shared across all reqests thereby resulting in the `accBalance` being shared across all accounts. You can of course synchronize all …

Member Avatar for Dean_Grobler
0
149
Member Avatar for nikita.chandra

[URL="http://stackoverflow.com/questions/1386275/why-java-vector-class-is-considered-obsolete-or-deprecated"]Don't use Vector[/URL].

Member Avatar for ~s.o.s~
0
82
Member Avatar for Katana24

Because each call to `readLine` bumps up/increments the file pointer, so as per your example, you effectively end up reading two lines in a single iteration. Declare a variable which would hold the string read and you should be good to go. [code]String str = null; while((str = reader.readLine()) != …

Member Avatar for ~s.o.s~
0
106
Member Avatar for Dean_Grobler

The error says that you are trying to invoke the method setAttribute with parameters (String, double) whereas the expected types are (String, Object). Simply put, the compiler expects the second parameter to be of any reference type but definitely not a primitive. Convert the `double` primitive value to `Double` and …

Member Avatar for Dean_Grobler
0
239
Member Avatar for Geekitygeek

[quote]Is it just me, or do you find your patience stretched rather thin when posting here at Daniweb sometimes?[/quote] A long time back, yes. Now? No. I've come up with a couple of simple points/markers which I use when answering threads: [LIST] [*]A post well written with a polite tone …

Member Avatar for Geekitygeek
0
269
Member Avatar for Pushpasheela

You can also use PreparedStatement which utilizes wildcards; just make sure that the "pin" you are setting already has those wildcard characters.

Member Avatar for ~s.o.s~
0
109
Member Avatar for ssimkhan

Reading [URL="http://java.sun.com/docs/books/tutorial/rmi/"]this [/URL]should definitely help you out, if not then post your code.

Member Avatar for nil2087
0
240
Member Avatar for NewOrder

Read the Javadocs for the Console class; it has the answer for your "why". [quote][...] Whether a virtual machine has a console is dependent upon the underlying platform and also upon the manner in which the virtual machine is invoked. If the virtual machine is started from an interactive command …

Member Avatar for JamesCherrill
0
200
Member Avatar for Dani

Another good thing might be to periodically mail out to members who have created threads but not marked them as solved after X number of days. This would help with members who might have wanted to mark their threads as solved but won't bother going to the website and searching …

Member Avatar for AndreRet
0
163
Member Avatar for Ezzaral

[quote]I would like though something less verbose instead of "You are currently viewing page 13 of this multi-page discussion thread;" for mobile use. [/quote] ^ Agreed; something like "Page 3 of 3" would be pretty awesome.

Member Avatar for ~s.o.s~
3
297
Member Avatar for sonamsinha23

Instead of Java 1.4/5 which you are using, you need to use JDK 6 since Console is a class which was introduced in Java 6.

Member Avatar for NormR1
0
61
Member Avatar for Premsathishbe

[quote]How Sun micro system given the rights to share the own product with Microsoft product Dot net for developing J#[/quote] Simple, because MS were not violating any patents/copyrights by doing so. If there were legal issues surrounding it, VJ# would never have been created. [URL="http://en.wikipedia.org/wiki/J_Sharp"]About J#[/URL] BTW, there is no …

Member Avatar for ~s.o.s~
0
85
Member Avatar for tennis

[quote]My question is will the 2 and true overwrite the 2 and false or they both exist in the Hashtable?[/quote] The value would be overwritten/updated for multiple `put`s done on the same `key`.

Member Avatar for NormR1
0
87
Member Avatar for Premsathishbe

The part in bold is called the [URL="http://download.oracle.com/javase/1.5.0/docs/guide/language/foreach.html"]enhanced for loop[/URL] which was introduced in Java 5. The program iterates over the variable number of double arguments ([URL="http://download-llnw.oracle.com/javase/1.5.0/docs/guide/language/varargs.html"]varargs[/URL]) passed to the method and computes their average.

Member Avatar for tong1
0
94
Member Avatar for glenak

Make sure you have the required libraries on your runtime classpath. Are you packaging your app as a JAR file or as class files? If you are running your app as a packaged JAR file make sure you have all the required dependencies present in the JAR file. If you …

Member Avatar for NormR1
0
9K
Member Avatar for NewOrder

[quote]i know what an interface is. but i dont understand what the use of connecting the objective reference to the interface method and then use it to implement..[/quote] Take a look at the [URL="http://en.wikipedia.org/wiki/Strategy_pattern#Java"]Strategy Pattern[/URL]. [URL="http://stackoverflow.com/questions/91932/how-does-the-strategy-pattern-work"]A bit more practical explanation[/URL].

Member Avatar for NewOrder
0
119
Member Avatar for glenak

AFAIK, you have two options: [LIST] [*]Use an alternative Java serialization implementation like Jboss Serialization which AFAIK doesn't require your classes to implement Serializable or Externalizable [*]In case you are concerned more about interoperability than speed, use something along the lines of Xstream or Protobuf [/LIST]

Member Avatar for glenak
0
137
Member Avatar for spv03

Two issues I see with the code you posted: - What is the point of setting the PreparedStatement parameters *after* adding a batch? - For executing a batch use `executeBatch` instead of `executeUpdate`

Member Avatar for ~s.o.s~
0
81
Member Avatar for BestJewSinceJC

[URL="http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.7"]Relevant section in the Java specification.[/URL]

Member Avatar for BestJewSinceJC
0
109
Member Avatar for glenak

Assuming you are creating a chat application, there are at least two ways of going about this one: * Create a language/platform independent protocol for your chat. This has the advantage that a client written in any language can communicate with your server, it need not always be a Java …

Member Avatar for ~s.o.s~
0
89
Member Avatar for miraj0072004

Read the [URL="http://ant.apache.org/manual/develop.html"]article presented at the official Ant site[/URL], especially the section which states: [quote]# Make sure the class that implements your task is in the classpath when starting Ant.[/quote]

Member Avatar for ~s.o.s~
0
378
Member Avatar for pritaeas

His issue is that the hyperlink created by vBulletin if a user posts a link without using the URL bbcode is broken for wikipedia article links which end with a ).

Member Avatar for Dani
0
114
Member Avatar for letheredge

A better option would be for you to configure the same in your web.xml file so that: * changes can be applied to all the JSP files with a single configuration * changing the configuration amounts to just changing the web.xml file and not each and every JSP Also, if …

Member Avatar for ~s.o.s~
0
352
Member Avatar for sportinguista

> At a certain moment my code makes this call: There is no need to spawn a separate process for this; just make sure that the JAR is in your classpath and invoke the `main` method of the class which has that method. E.g. [code]import your.jar.pkg.MainClass; public class Test { …

Member Avatar for ~s.o.s~
0
153
Member Avatar for diafol

[quote]I know there's more to this than just helping the OP, etc. But seriously, could this be done? The profile panel of an idiot would then have some sort of icon (only visible to the idiot-applying user of course).[/quote] Use the ignore list feature provided by vBulletin. If I've added …

Member Avatar for Lusiphur
0
353
Member Avatar for emclondon

On behalf of the moderators here I think I've already given a fairly good reply to your query via PM as to "why" we don't delete threads on user request. Unfortunately, creating a thread in the Community Feedback section won't change it since rules are rules which have to be …

Member Avatar for Dani
-1
282
Member Avatar for developer@india

[quote] Can I say:"the memory size for boolean varies on different computer platform"? [/quote] No, when someone asks you the size of a boolean, you state exactly what is stated in the JVM spec, no more, no less. This is because saying that "it varies on different platforms" would be …

Member Avatar for ~s.o.s~
0
223
Member Avatar for zandiago

> Am I supposed to care? If there's no penalty, why not? Don't pirate to pirate, just pirate. If you feel like owning MS Windows without paying for it, do it, but don't expect to seek justifications for your action. If you feel like being part of the *good* and …

Member Avatar for jon.kiparsky
2
981
Member Avatar for Ancient Dragon

My signatures are always enlightning...either in a positive or a negative way...:D

Member Avatar for vegaseat
0
213
Member Avatar for glenak

[quote]Every example I've seen, the stream has to be flushed, but I don't know why[/quote] Some implementations of the OutputStream/Writer (e.g. BufferedWriter) buffer the data written to them and write it to the underlying actual stream only when the buffer is full. This is so as to avoid doing IO …

Member Avatar for glenak
0
149
Member Avatar for anz2050

Instead of using Runtime class, just include the given JAR in your application and use the relevant method of the relevant class. [code] package your.pkg; import com.salesforce.lexiloader.security.EncryptionUtil; class YourClass { public static void main(final String[] args) { byte[] encrypted = EncryptionUtil.encrypt(bytes); } }[/code] This of course assumes that there is …

Member Avatar for anz2050
0
248
Member Avatar for jemimaloh

The runtime error thrown is pretty clear here; you are trying to parse the string "0.0 0.0" as an integer which won't work for obvious reasons and hencefails. Here is something you should attempt, one step at a time: [LIST] [*]Read a single line from a file, print that line …

Member Avatar for ~s.o.s~
0
133
Member Avatar for prem2
Member Avatar for prem2
0
39
Member Avatar for JamesCherrill

As already noted, you can't use the 'new' expression to create a new object at runtime given the way generics are implemented in Java. IMO, the cleanest (type-safe without any warning) approach you can come across can be achieved by passing in the class of the object you have to …

Member Avatar for JamesCherrill
0
192
Member Avatar for emmas4impact

> Can anyone give me an idea on how to insert multiple record into a database. Search for "Batch insert JDBC". Links which might interest you: [url]http://www.java2s.com/Code/Java/Database-SQL-JDBC/BatchUpdateInsert.htm[/url] [url]http://www.jguru.com/faq/view.jsp?EID=5079[/url]

Member Avatar for emmas4impact
0
3K
Member Avatar for Fasola

> ??? You would need to use a server side language / API like PHP or J2EE respectively along with some database as backend to implement your project. It can't be done in Javascript along since it's a client side scripting language used to enhance site usability and not provide …

Member Avatar for atrueresistance
0
150
Member Avatar for mohammed2raja

That's a pretty vague description you've got there; *what* sort of problems? Please ask specific questions so that people can render specific help.

Member Avatar for mohammed2raja
0
108
Member Avatar for cpp.coder37
Member Avatar for ~s.o.s~
-6
231

The End.