35,618 Topics

Member Avatar for
Member Avatar for Dhanesh10

Here is my java connectivity code to Oracle [CODE]public class OracleConnectivity { public Connection con; public Connection getConnection () { try { Class.forName("oracle.jdbc.driver.OracleDriver"); con=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:dhanesh","dhanesh","root"); Statement s=con.createStatement(); s.executeUpdate("insert into test (num,txt) values (2,'hi')"); s.close(); con.close(); } catch(Exception e) { System.out.println("Connection failed"); e.printStackTrace(); } return con; } public static void main(String[] args) …

Member Avatar for database_nitesh
0
450
Member Avatar for jackbauer24

Here is my code:- [CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package wrie.and.read; /** * * @author Administrator */ import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.*; import javax.swing.*; public class WrieAndRead { JFrame frame; JTextField field; /** …

Member Avatar for jackbauer24
0
172
Member Avatar for aliasadsahu

[CODE]class Animal { private String type; Animal theAnimal = null; // Declare a variable of type Animal public Animal(String aType) { type = new String(aType); } public String toString() { return "This is a " + type; } } class Dog extends Animal{ private String name; // Name of a …

Member Avatar for JamesCherrill
0
125
Member Avatar for capella2

I have been working on this topic for three days. I can not seem to solve the problem. I need to generate tree when the user enter binary with the corresponding variable the tree should be generated recursive until a certain condition is met. This topic is new to me. …

Member Avatar for NormR1
0
277
Member Avatar for chieny

DEPOSIT and WITHDRAWAL ERROR MESSAGE: Input Amount:Exception in thread "main" java.lang.NullPointerException at Soft_eng.ATM.main(ATM.java:226) there is a logic error or whatever error in deposit and withdrawal. :( there is a little problem in new account. when the system reaches 11 records it cause to force shutdown of this atm system. [CODE] …

Member Avatar for NormR1
0
550
Member Avatar for nered

Hi, So i got pretty far whit Java i covered basic operation, GUI w/e MVC design etc. It been a fun year learning Java. Now i want to make an application for communication between two points similar to a TFTP Server/Client. So this is how i visioned this to go: …

Member Avatar for JamesCherrill
0
431
Member Avatar for justindill

If I close off the for loop it works but I need to get the output to show as a dialog box as well. I need the output to show inside a dialog box: Output should include count of numbers entered the sum of the numbers the average of the …

Member Avatar for NormR1
0
895
Member Avatar for ali.jay110

Hi There is something about this code that does not seem right has anyone got any ideas? It does not matter what it does. I mean from a constructor/inheritance point of view. Some of the points I made were one constructor was passing a null value, which in turn was …

Member Avatar for ali.jay110
0
340
Member Avatar for angryKitten

Hi, I'm trying to learn some Java for fun and got a question about comparing integers. If I wish to compare int a to int b and check for equality that's pretty straightforward and easy, but if I want a method to return equal for different values I get a …

Member Avatar for JamesCherrill
0
137
Member Avatar for divsok

can i directly send a message as a gmail which typed in a textarea in a jsp? please explain anybody how to do it ?

Member Avatar for peter_budo
0
81
Member Avatar for v3ga

My objective is to implement a GUI calculator in java. I am thinking of passing the expression entered by the user to bc and then get output from terminal and print to user. My question is [LIST=1] [*]How to execute a terminal command from java so that i can pass …

Member Avatar for v3ga
0
358
Member Avatar for ShaRp codeR

Hello, I would like to know any information about "UML Diagram Generator" from the code or if there is any good software which can enable me to make quick UML Diagrams from the code for my University Assignments. I have been looking for one but did not find anything good. …

Member Avatar for ShaRp codeR
0
384
Member Avatar for mags11

I am trying to get the program's decimal to output in two decimal places after the decimal. Please advise. [CODE] // MilesPerGallon.java // Program designed by XY import javax.swing.JOptionPane; // Needed for JOptionPane. import java.text.DecimalFormat; // Keeping proper decimal format. public class MilesPerGallon { public static void main(String args[]) { …

Member Avatar for mags11
0
2K
Member Avatar for long89

I don't know how to write code to exit for this program.someone please help me :( [CODE] import java.awt.*; import javax.swing.*; import java.awt.event.*; public class Panel extends JPanel implements ActionListener{ private JTextField height, weight, answer; private JButton calc, clear, exit; public Panel(){ this.setLayout(new GridLayout(2,1)); JPanel topPanel = new JPanel(); topPanel.add(new …

Member Avatar for long89
0
210
Member Avatar for shifat96

Hello, I have a Computer Science project for school. I am done writing the full code but I am missing one of the requirements. Some of the text have to be aligned to the right. Here's an excerpt from my code which I want to change the alignment: [CODE] System.out.print …

Member Avatar for shifat96
0
936
Member Avatar for zina_a

hi, I have to make an application in java to access the switch of the my company and show his details(host name,IP adress,MAC adress,time fonctionnemnt...),also if any one tell me how can I make it,some samples in java abouth that would be helpful.

Member Avatar for zina_a
0
168
Member Avatar for jot121

here is the details I got: 1. Create a class called 'GuessMyNumber'. The constructor should chose a random number between 1 and 100. There should be a method 'guess(int guess)' that returns -1 if the guess is too low, 0 if the guess is correct, and 1 if the guess …

Member Avatar for NormR1
0
216
Member Avatar for RLS0812

It's going on 4 hours now, and I have yet to find an answer on how to do this. All I want to do access and manipulate data in a list, from another class. The 2 classes: [B]GetList.java[/B] [CODE]public class GetList { public static void main(String args[]) { MakeList xx …

Member Avatar for FALL3N
0
308
Member Avatar for TIM_M_91
Member Avatar for riahc3

Hey I want to use something like Dreamweaver to design a HTML page. (Excluding all the links to pictures and such) how do I get Java to get all that and convert it to a well designed PDF document like I was seeing in Dreamweaver? Thanks

Member Avatar for peter_budo
0
318
Member Avatar for tharindupro
Member Avatar for newbie14

I have socket connection which keep reading data and then it will send it via a queue for next processing in another thread. I notice at times it just stop sending data to the queue. I will print this System.out.println("\n\nSending TO QUEUE : "+message); and stop but I do not …

Member Avatar for JamesCherrill
0
376
Member Avatar for devin2203

I needed to implement a simple cyclic graph in Java so it have nodes in such a way that it can be implemented to represent adjacency matrix or list. Any advice or resources to hep me start implementing this would be much appreciated! Many Thanks

Member Avatar for NormR1
0
391
Member Avatar for dsmith12

So my code is suppose to get information from the user and figure out how much funding the two professors get. My code runs twice but for some reason only the last entry is saved and outputted and my formula for calculating the new funding only outputs zero for some …

Member Avatar for stultuske
0
220
Member Avatar for riahc3

Hey I have a folder in my current working path and I want to make a copy of a file inside it to the the current working path. Its kind of a dumb question, I know, but how do it do it? Thank you.

Member Avatar for riahc3
0
210
Member Avatar for riahc3

Hey I have this following code: [code] try { // Connection props Properties props = new Properties(); props.setProperty("mail.smtp.host", host); props.setProperty("mail.smtp.starttls.enable", "true"); props.setProperty("mail.smtp.port", "25"); props.setProperty("mail.smtp.user", usuario); props.setProperty("mail.smtp.auth", "true"); // Prepare the session Session session = Session.getDefaultInstance(props); // Constuct the message MimeMessage message = new MimeMessage(session); /*Test*/ message.setHeader("Content-Type", "multipart/mixed"); message.setFrom(new InternetAddress(CorreoOrigen)); message.addRecipient(Message.RecipientType.TO,new …

Member Avatar for riahc3
0
208
Member Avatar for Tango2010

Hi All, I wonder if anyone can help - I have been teaching myself Java GUI programming using a Mac running OSX Lion and Netbeans 7, and have followed the tutorial: [url]http://netbeans.org/kb/docs/java/gui-functionality.html#Exercise_2[/url] When I run the program, it builds and compiles fine, but only appears when I choose the command …

Member Avatar for Tango2010
0
157
Member Avatar for mohamed moamen

I'm send sound between two clients via UDP server Socket , How i can make users not feel the delay of sound ?

Member Avatar for JamesCherrill
0
91
Member Avatar for abhijeet P

Hello all, I have a code to encrypt data in C# and I want it to b decrypted in Java... following is the C# code [CODE]string Encrypt(string textToEncrypt, string key) { RijndaelManaged rijndaelCipher = new RijndaelManaged(); rijndaelCipher.Mode = CipherMode.CBC; rijndaelCipher.Padding = PaddingMode.PKCS7; rijndaelCipher.KeySize = 0x80; rijndaelCipher.BlockSize = 0x80; byte[] pwdBytes …

0
78
Member Avatar for shean1488

Hi everybody. I have a class Sudoku. And puzzle stores 2D array of type Cell. [CODE]public class Sudoku implements Iterable<Cell []> { private Cell [] [] puzzle;[/CODE] What I want to do is to iterate through the puzzle in different class (SudokuValidator): [CODE]public class SudokuValidator { private Sudoku puzzle;[/CODE] how …

Member Avatar for JamesCherrill
0
122

The End.