3,892 Posted Topics
Re: 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 … | |
Re: [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 … | |
Re: 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 … | |
Re: [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 … | |
Re: > 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 … | |
Re: [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? … | |
Re: 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 … | |
Re: 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. :-) | |
Re: [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. | |
Re: @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 … | |
Re: 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 … | |
Re: 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 … | |
Re: [URL="http://stackoverflow.com/questions/1386275/why-java-vector-class-is-considered-obsolete-or-deprecated"]Don't use Vector[/URL]. | |
Re: 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()) != … | |
Re: 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 … | |
Re: [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 … | |
Re: You can also use PreparedStatement which utilizes wildcards; just make sure that the "pin" you are setting already has those wildcard characters. | |
Re: Reading [URL="http://java.sun.com/docs/books/tutorial/rmi/"]this [/URL]should definitely help you out, if not then post your code. | |
Re: 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 … | |
Re: 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 … | |
Re: [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. | |
Re: 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. | |
Re: [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 … | |
Re: [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`. | |
Re: 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. | |
Re: 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 … | |
Re: [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]. | |
Re: 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] | |
Re: 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` | |
Re: [URL="http://java.sun.com/docs/books/jls/third_edition/html/conversions.html#5.1.7"]Relevant section in the Java specification.[/URL] | |
Re: 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 … | |
Re: 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] | |
Re: 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 ). | |
Re: 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 … | |
Re: > 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 { … | |
![]() | Re: [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 … |
Re: 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 … | |
Re: [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 … | |
Re: > 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 … | |
Re: My signatures are always enlightning...either in a positive or a negative way...:D | |
Re: [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 … | |
Re: 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 … | |
Re: 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 … | |
Re: Google for "jboss download" and you should be good to go. | |
Re: 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 … | |
Re: > 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] | |
Re: > ??? 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 … | |
Re: 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. | |
Re: Thread closed to prevent bashing of someone who has already apologized. Peace. :-) |
The End.