35,618 Topics
![]() | |
I'm trying to connect mysql database through API, and I'm using the following coding. I could't get the proper access to the database. Do I need to create a JDBC to the database or is there any other options available? <%@page import="java.sql.DriverManager"%> <%@page import="java.sql.ResultSet"%> <%@page import="java.sql.Statement"%> <%@page import="java.sql.Connection"%> <% String … | |
I'm packaging my java program as a jar..it includes mysql-connector.jar..it runs fine when i run it in eclipse..now i need to distriute the jar file..I packaged the jar file and when I run it through command line using java -jar myprogram.jar, it throws ClassNotFoundException: com.mysql.jdbc.Driver could anyone please tell me … | |
Hello, I need to build the following GUI  and as usual I was hoping to have some advice before I start building it. In particular, I wonder if you guys think I should have any JPanel at all or if it is better to attach everything to the … | |
Hello. I want to be able to create a listener for a cell in my JTable. Whenever write a number in a JTable (every key release) I want the value on the other column to decrease something like this: Quantity|Borrow 10 | 0 8 | 2 i use window builder … | |
So I just finished up a way to solve Standard Form Quadratic Equations, Now I want to code a way to automatically Convert a given Standard Form equation to Vertex Form, or Vertex to Standard. Is it possible due to the fact that you have to get a perfect square … | |
Hello good afternoon. I have successfully serialized data in the past, however it seems as if I don;t fully understand the process. I have a class called ProgramState which stores a variable (called lastCreated) with custom class LinesProject and an ArrayList variable(called recentProjects) of this custom class. The purpose of … | |
Needing some help with a small problem. I have this program that is not compiling correctly. The instructions are simple which are: The PairTest should prompt the user for the two values, create a Pair object with the values and then print the average, distance, maximum, and minimum of the … | |
How do i post my codes on here? I did it once by accident and don't remember how i did it. | |
This is just a simple program that acts as a calculator for school age children. My professor requested that I add a declarations section. If possible could someone help me which parts of my code I need to add. | |
I am a #rd yr. B.Tech student & want to do projects on C & Linux Shell Programming.It will be of great help if I can be supplied with some project titles for freshers with industry relevence. Thanking you, Supra | |
import java.util.*; public class n00883428 { public static void main(String[] args) { Scanner in = new Scanner(System.in); { int i; int j; int numPeople; int numCount; int upTo = 0; long memory; long startTime; long endTime; System.out.print("How many people are in the circle?"); numPeople = in.nextInt(); System.out.print("Enter number to count … | |
Hello, new to Java and I've been doing some coding for a few weeks. Right now I am stumped. I've been trying to make a program that would display how many days are in the month when the user inputs a month number, but it keeps saying that DaysInMonth.java:64: error: … | |
Hi Team, I have two java Files 1. Print (Package A) 2. Apple (Package B.C) (Jave file is inside C:\Z\A\B\C\ I have compiled and kept Print.class file inside C:\Z\A\B\A\ Now i have made a Jar file of Print.class named MyJar.jar and kept it in Z\A\ When i try to compile … | |
I'm not sure how to normalize the values to get the output that I want. I created a method called normalize. The values come from my txt file. The output I want is - Quizzes: 66% Labs: 88% Lab attendance: 81% Midterms: 91% import java.io.*; import java.util.*; public class FindGrade … | |
Hi Team, I am almost going to finish learning core Java and my employers said openings are available for Hibernate/Spring/Struts. I am just wondering whether can i directly start studying one of these frameworks after Core Java. Some people said these Frameworks contains JSP,servlets and important J2EE concepts so that … | |
I am trying to finsih this coding and something is missing and teacher has asked me to init the doubles. I am struggling with the finishing touches of this program. import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * The MenuWindow class demonstrates a menu system. */ public class CellPhonePackage extends … | |
I want to make a program to accept strings and make a pyramid of strings, but I cant make the right loop, I have the logic: But this seems to make only half- pyramid, can somebody help me with the right loop import java.util.Scanner; public class Stairs { public void … | |
Hi , i have done a project in servlet , i didn't get any error in the coding and console page . My problem is that datas are not added to the database. Below are my files. What i'm doing wrong ? StudentRegistration.html <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" … | |
Hi all - I am writing a program that uses two classes: One class is the InfixtoPostfix, which is actually the class that changes expressions from infix to postfix. (Example: ( A + B ) * ( C - D ) to A B + C D -*. The second … ![]() | |
Hi Team, Im preparing for OCJP and in one of the sample question is below Three version of MyClass.class exist on a file system 1. /foo/bar/ 2. /foo/bar/baz 3. /foo/bar/baz/bing And the system class path includes /foo/bar/baz And this is the command invoked from /foo java -classpath /foo/bar/baz/bing:/foo/bar MyClass Which … | |
I have a studied java and self taught on netbeans. i would like to use open source APIs and packages for writing heuristics and machine learning programs but dont know where to start. How to learn to use a new API ? Like genetic algorithm package or metaheuristic package? I … | |
my code: class A{ Vector<String> s = new Vector<String>(); } public class Vec { /** * @param args the command line arguments */ public static void main(String[] args) { A a = new A(); a.s.add("String1"); a.s.add("String2"); a.s.add("String3"); a.s.add("String4"); a.s.add("String5"); Vector<A> vecA = new Vector<A>(); vecA.add(a); System.out.println("Size of vector is "+vecA.size()); … | |
I am trying to get 20 images displayed on a jframe in jlabels using a gridlayout. I have added a while loop but still i am only am to see 1 image, please can you help me to display more than image in jlabels on a jframe? setSize(600, 600); setDefaultCloseOperation(HIDE_ON_CLOSE); … | |
hai to all iam decided to develop student information report so i decided to the gathering results from site and those converted to either .pdf or .xls file so i requested to code for to obtain the student reults from the any website thanking you sir | |
Im using hibernate and i tried to do the following session.get(Company.class, 1); After i executed the statement above i got this strange select statement generated by hibernate Hibernate: select company0_.Company_ID as Company1_31_4_, company0_.version as version2_31_4_, company0_.Address_ID as Address5_31_4_, company0_.Company_Code as Company3_31_4_, company0_.Company_Name as Company4_31_4_, company0_.Phone_ID as Phone6_31_4_, address1_.Address_ID as Address1_0_0_, … | |
Hi, could some one help me in resolving this issue. Below is the code in which i am trying to call open Calais API to extract the keywords from the content by using the lisence key. package com.clearforest; import java.rmi.RemoteException; import javax.activation.DataHandler; import javax.mail.internet.MimeMultipart; import javax.xml.rpc.ServiceException; public class CalaisDemo { … | |
Hey Guys, could you tell me the different ways to write throw method (Exception Handling) in a program.. I mean like we can write BufferedReader in many ways (2 ways so far i've studied).. eg; 1. BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); 2. BufferedReader br; { br = new BufferedReader(new InputStreamReader(System.in)); } | |
Assignment 1: Bank Account Class You are hired by a Canadian bank in order to develop a java application for processing withdraw and deposit transactions. The application enables staff of the bank to create new bank accounts, to process account transactions and to display the balance of a particular account. … | |
class A{ Vector<String> s = new Vector<String>(); } public class Vec { public static void main(String[] args) { A a = new A(); a.s.add("String1"); a.s.add("String2"); a.s.add("String3"); a.s.add("String4"); a.s.add("String5"); Vector<A> vecA = new Vector<A>(); vecA.add(a); System.out.println("Size of vector is "+vecA.size()); // here i am getting size one a.s.clear(); a.s.add("String6"); a.s.add("String7"); a.s.add("String8"); … | |
Should have the Menu: [1] Empty WaterGlass [2] Add Water [3] Remove Water [4] Display WaterGlass [5] Exit ** Note: The program will only end if the Exit Menu is chosen. java program Sample WaterGlass: Current Level: 10 *** --- --- --- --- --- --- --- --- --- --- *** … |
The End.