35,618 Topics
![]() | |
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) … | |
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; /** … | |
[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 … | |
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. … | |
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] … | |
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: … | |
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 … | |
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 … | |
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 … | |
can i directly send a message as a gmail which typed in a textarea in a jsp? please explain anybody how to do it ? | |
![]() | 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 … ![]() |
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. … | |
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[]) { … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
| |
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 | |
| |
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 … | |
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 | |
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 … | |
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. | |
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 … | |
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 … | |
I'm send sound between two clients via UDP server Socket , How i can make users not feel the delay of sound ? | |
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 … | |
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 … |
The End.