Forum: Java 3 Days Ago |
| Replies: 14 Views: 341 Modify the hash method to
private int hash(char[] key){
int hashVal = 1;
int prime = 31;
for(int i = 0; i < key.length-1; i++){
hashVal = prime *... |
Forum: Java 15 Days Ago |
| Replies: 2 Views: 427 hbm mappings for MS SQL server require additional properties which I just figured out with the help of Netbeans.
Thanks to Netbeans
The additional properties are schema and catalog
I... |
Forum: Java 15 Days Ago |
| Replies: 2 Views: 427 Seems there's a communication gap between Hibernate and SQL Server Express Edition (2005/2008).
I tried to use Hibernate with SQL Server 2005 and 2008 Express Edition but in vain.
Finally, gave... |
Forum: Java 18 Days Ago |
| Replies: 2 Views: 284 For a simple online store you don't really need to know JSF. However, you should know Servlets and JSP for the same in Java world. Also, do not use JDBC-ODBC bridge. Use JDBC Type 4 driver available... |
Forum: Java 18 Days Ago |
| Replies: 6 Views: 309 You can store the results in to two separate maps. Then iterate over each map and compare each object in the two maps. |
Forum: Java 19 Days Ago |
| Replies: 2 Views: 427 I've been trying to get a list of values from database using hibernate.
I'm using MS SQL Server XE 2005 and using Hibernate 3.2.2 to fetch DB rows. I've tried JDBC drivers provided by Microsoft as... |
Forum: Java Dec 6th, 2007 |
| Replies: 2 Views: 571 Hi,
I'm trying to reproduce a Production Exception. In order to reproduce it I want to limit the size of my log file. Is there a way so that I can limit the size of my log i.e., my log should not... |
Forum: Java Dec 3rd, 2007 |
| Replies: 6 Views: 1,498 Do your eclipse knows the directory of Tomcat? Have you configured it?? |
Forum: Java Nov 29th, 2007 |
| Replies: 11 Views: 6,068 In this forum the rule is not to do somebody else's homework or project work. Whether its a question of 100 marks or 1000 marks. You have to do the ground work and ask for help where required. We are... |
Forum: Java Nov 29th, 2007 |
| Replies: 2 Views: 1,912 Are you using WTP plugins with eclipse or simply eclipse. If in case you are using simply eclipse, then there is no way to configure your App Server with it. However, you can still compile your... |
Forum: Java Nov 24th, 2007 |
| Replies: 7 Views: 4,324 This was interesting. It was really skipping the readLine(). So try this..
System.out.println( "\n¿De que pueblo desea buscar informacion? " );
input = new Scanner(System.in);
... |
Forum: Java Nov 24th, 2007 |
| Replies: 7 Views: 4,324 if you didn't got the exception here
nombreDocTXT = input.next();
then you can't get it when calling nextLine(); because it's just another method of Scanner class. However, can you provide your... |
Forum: Java Nov 23rd, 2007 |
| Replies: 7 Views: 4,324 Have you used Scanner.nextLine()?? |
Forum: Java Nov 23rd, 2007 |
| Replies: 7 Views: 10,147 |
Forum: Java Nov 23rd, 2007 |
| Replies: 7 Views: 1,411 I have used static nested classes in struts to populate a html list from database objects. If you are using struts you might find them handy. |
Forum: Java Nov 22nd, 2007 |
| Replies: 6 Views: 15,184 Database drivers (jdbc,odbc,.net...) are provided by database vendors or third party vendors and not generated. JDBC drivers are loaded into the JVM at runtime.
Please refer some books on JDBC... |
Forum: Java Nov 22nd, 2007 |
| Replies: 1 Views: 493 Read weblogic documentation regarding services. You can also create a startup batch script. |
Forum: Java Nov 22nd, 2007 |
| Replies: 3 Views: 4,174 An example can be found here:
http://www.novocode.com/doc/servlet-essentials/chapter3.html |
Forum: Java Nov 21st, 2007 |
| Replies: 5 Views: 2,199 Use the following piece of code to get Windows OS Look And Feel
try {
//org.fife.plaf.VisualStudio2005.VisualStudio2005LookAndFeel... |
Forum: Java Nov 11th, 2007 |
| Replies: 2 Views: 5,005 U should use java.util.Random or Math.random() to generate random numbers. |
Forum: Java Oct 11th, 2007 |
| Replies: 4 Views: 2,509 Well in that case I simply add a readline statement after the print statement. So unless and until you don't press a key it won't exit. |
Forum: Java Oct 1st, 2007 |
| Replies: 3 Views: 837 People write specific dlls that are specific to their applications and there dlls are required to be registered with Windows registry so that the calling application knows where the library can be... |
Forum: Java Sep 28th, 2007 |
| Replies: 14 Views: 1,641 Java is both - a Framework and a Language. As a Language, it has all the features of a programming language. As a framework it laids down the requirements which must be met by all the vendors... |
Forum: Java Sep 22nd, 2007 |
| Replies: 10 Views: 4,480 Any number multiplied by 0 is always 0. |
Forum: Java Sep 22nd, 2007 |
| Replies: 10 Views: 4,480 You are not passing the parameters in your setters but in your getters so all these errors.
Just make changes like
public void setTotalPayment(double d){
totalPayment = ;//or... |
Forum: Java Sep 22nd, 2007 |
| Replies: 4 Views: 1,697 So what's ur exact problem? Displaying the result, or reading from commandline or what? |
Forum: Java Sep 22nd, 2007 |
| Replies: 1 Views: 748 Yes you can. Refer Dietel Programming in Java. |
Forum: Java Sep 21st, 2007 |
| Replies: 12 Views: 2,746 It works pretty fine. I think your source file name is different than the class name i.e., PayrollApp. Rename the source file to PayrollApp.java. |
Forum: Java Sep 17th, 2007 |
| Replies: 6 Views: 1,033 Ok ! I thought you wanted a reusable bean so I made the changes that way.
However, I think you are missing to put the mysql jdbc driver in the classpath of your program.
You can download it... |
Forum: Java Sep 17th, 2007 |
| Replies: 6 Views: 1,033 Ok I didn't closely examined the mysql stuff sent by you. Your's is also running on 3306 (default port). But you've to change the password to whatever your root password is. |
Forum: Java Sep 17th, 2007 |
| Replies: 6 Views: 1,033 Hi,
I have made some changes to the source code and made it work. You have to do the additional CreditCard related stuff yourself. In any case feel free to drop a message. Find the source in... |
Forum: Java Sep 16th, 2007 |
| Replies: 2 Views: 1,066 This works absolutely file. Try it.
package applet;
import java.awt.Graphics;
/**
*
* @author desperado
*/ |
Forum: Java Sep 16th, 2007 |
| Replies: 8 Views: 1,113 You are making the same mistake. You are not giving the database name in your URL. Your URL should be jdbc:mysql://localhost:8084/ccbd |
Forum: Java Sep 16th, 2007 |
| Replies: 8 Views: 1,113 Your code doesn't seem to be correct. It should be something thing like:
package db;
import java.sql.*;
import java.sql.DriverManager;
import java.sql.Connection;
/**
*
* @author James
*/ |
Forum: Java Sep 16th, 2007 |
| Replies: 8 Views: 1,113 Moreover, if you are creating a bean, why are you hardcoding the connection related params? Why don't you use the bean setters to initialize the values?? |
Forum: Java Sep 16th, 2007 |
| Replies: 8 Views: 1,113 You are required to mention the database name too which u r missing. Jst add the db name as given below
try{
Class.forName("org.gjt.mm.mysql.Driver");
... |
Forum: Java Sep 12th, 2007 |
| Replies: 3 Views: 2,992 Well please don't abuse anybody here. You seen to be programming your code in C# -> Console.writeline(). So please post it to C# posts. You will get C# related answers there. |
Forum: Java Sep 11th, 2007 |
| Replies: 7 Views: 1,318 You can also use JDBC 2.0 enhancements. Try the following code for inserting.
ResultSet rs = statement.executeQuery("Select * from Employees");
rs.moveToInsertRow();... |
Forum: Java Sep 11th, 2007 |
| Replies: 2 Views: 592 The folowing link of java util API can provide help.
http://72.5.124.55/j2se/1.5.0/docs/api/java/util/GregorianCalendar.html#add(int,%20int)
There was another DateUtility which was posted earlier... |
Forum: Java Sep 10th, 2007 |
| Replies: 1 Views: 624 please refer to the Sun tutorial available on http://java.sun.com/docs/books/tutorial/javabeans/beancontext/containment.html |