31,001 Topics

Member Avatar for
Member Avatar for achava

As part of a class in Java, the constuctor is supposed to throw a java.lang.IllegalArgumentException exception when an integer that is a field in the class, let's call it int N, is set to a negative vale. How do I set this up?

Member Avatar for achava
0
215
Member Avatar for Munazza_1

Respected members, I have this code chunk that should read multiple text files from a folder. I am later calculating their probability. For one file it is working fine and methods are also showing output. The first code is for ONE FILE named as English.txt. BufferedReader reader = new BufferedReader(new …

Member Avatar for JamesCherrill
0
2K
Member Avatar for altjen

try{ String b = jTextField1.getText(); String sql = "SELECT * FROM DataImput ORDER BY InvoiceNumber=?"; pst=conn.prepareStatement(sql); pst.setString(1, b); rs=pst.executeQuery(); jTable1.setModel(DbUtils.resultSetToTableModel(rs)); } catch(Exception e){ JOptionPane.showMessageDialog(null, e); } finally{ try{ rs.close(); pst.close(); } catch(Exception e){ } } } this is the code I work to search. it actually work. but really weird. …

Member Avatar for stultuske
0
143
Member Avatar for hwoarang69

I set up a servlet project in eclipse and I am trying to connect a Access databasae(Ucanaccess) with it. By looking at below error, its look like I am missing jar files but if you take a look at attchement image. You will see all my jar files are in …

Member Avatar for jwenting
0
2K
Member Avatar for Saboor880

Hi Friends. I am facing Microsoft ODBC Driver error at run time in my program. I am using window 7, jdk 7 and Ms Access 2007. I am using "jdbc:odbc:JdbcOdbcDriver". I am giving code and error message below. Please tell me solution of this problem import java.sql.*; public class JdbcDMLEx2 …

Member Avatar for JamesCherrill
0
279
Member Avatar for Saboor880

HI to all! I am facing some exceptions in my database connectivity programs. I am using jdk7, window7 and Ms Access 2007. I am giving code of programs and exeption. import java.sql.*; public class ResultSetEx { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:personDSN"; Connection …

Member Avatar for JamesCherrill
0
185
Member Avatar for അരുൺ

Assume that a bank maintains two kinds of accounts for customers,one called as Savings account and the other as Current Account.The Savings account provide compound interest and withdrawal facilities but no cheque book facility.The Current Account provides cheque book facilty but no interest. Current Account holders should also maintain a …

Member Avatar for JamesCherrill
0
1K
Member Avatar for altjen

Im having ap roblem with this. ![1.JPG](/attachments/small/4/cde330e9ebb2a478c54b56e4280cf4a3.JPG "align-left") after I press Save button that image show up it doesnt execute this code String te1 = tf1.getText(); String te2 = TA3.getText(); String te3 = TA2.getText(); String te4 = TA1.getText(); String te5 = tf2.getText(); String te6 = TL1.getText(); String sql = "UPDATE …

Member Avatar for altjen
0
253
Member Avatar for hwoarang69

I am trying to connect access database with eclipse but it is not working. I first created data source in "ODBC Data Source Administrator(32-bits)" for windows than I add the jar file But I am getting an error: ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver SQLException: No suitable driver found for jdbc:odbc:J2EE_Database public class ex01 …

Member Avatar for ~s.o.s~
0
655
Member Avatar for Jhajha

**Create a java program that will accept 3quizzes grades then display the average. Pahelp nmn po dito. about sia sa import java.util.scanner at system.in at scanner kailangan daw isearch muna yan pra mlaman kung panu gawin ung program. pahelp po salamat po :D**

Member Avatar for JamesCherrill
-1
65
Member Avatar for altjen

can someone please tell me how to fix this thing? Im loosing my mind here. in a form this code work well. in other it doesn't I create an other form, import everything again and it is not working! try{ int row = Data_Table1.getSelectedRow(); String Table_click1 =(Data_Table1.getModel().getValueAt(row, 0).toString()); String sql …

Member Avatar for stultuske
0
169
Member Avatar for Vansh_2

I am developing a server which detects a device and its connection speed . is there any way i can detect a client's connection speed through response headers ?? public class Server_X { static int count = 0; public static void main(String args[]) { Socket s = null; ServerSocket ss2 …

Member Avatar for Karan_8
0
536
Member Avatar for altjen

Hi. Im trying to write specific text in a .txt file that file would be imported inside a folder I use this to create a file or folder File folder = new File("d:"+IN.getText()); if (folder.mkdir()){ System.out.println("Batch is created!"); }else{ System.out.println("This batch already exists."); } can create a .txt with a …

Member Avatar for JamesCherrill
0
248
Member Avatar for hwoarang69

I am using Eclipse, java8 I am trying to connect access database with eclipse but it is not working. I first created data source in "ODBC Data Source Administrator(32-bits)" for windows and than I added the jar file (mysql-connector-java-5.1.35-bin) But I am getting an error: ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver at …

Member Avatar for hwoarang69
0
912
Member Avatar for Kate_2

Help pls. I need to make a program. A program that calculates an employee’s pay per week. Obtain from the user an hourly pay rate and the number of hours worked for the week. Calculate their pay for the week (no overtime, and no taxes).

Member Avatar for JamesCherrill
0
70
Member Avatar for Doogledude123

I'm curious, when setting the default close operation for JFrames, should you use JFrame's constants or WindowConstants' constants? As far as I can tell they're the same. Although, IntelliJ (not tested on other IDE's) prefers WindowConstants' EXIT_ON_CLOSE at least. So basically my question is, which one should be used? Which …

Member Avatar for JamesCherrill
0
289
Member Avatar for Andyjava

Hello, i am planning on designing an airline mobile application with android, as my testing devce. i'm doing this for the first time, can someone please guide me on how to do this? All help wiil be appreciated

Member Avatar for serenagrace
0
192
Member Avatar for Aditya0025

hello..... i am new in the coding field..... and i understand the working of codes in java......but couldn't able to start.....i have to make a program of videoconferencing.....how to start coding on it.....

Member Avatar for jwenting
0
184
Member Avatar for 9ja boy

Write a java program that accept two numbers from the user and print out the following sample out first number: 7 second number: 2 the second number goes in to the first number 3 time with a remainder of 1.

Member Avatar for JamesCherrill
-1
327
Member Avatar for Doogledude123

Is this try catch block enough to ensure the process ran successfully? protected boolean attemptLaunch() { try { System.out.println("Attempting to open '" + name + "'."); //Try to open the Process new ProcessBuilder(path).start(); return true; } catch (IOException e) { System.out.println("Opening failed. Will retry during next Iteration."); return false; } …

Member Avatar for jwenting
0
281
Member Avatar for mike chibundi

Am coding a college council voting system for my school in netbeans and mysql saver. i have populated jtables containing cadidates (jtable1 for president, jtable2 for vice president etc) and i have put a jbutton so that after sellecting candidents of choice one from each jtable, you click the jbutton …

Member Avatar for JamesCherrill
0
326
Member Avatar for Jagdeep_1

I am using eclipse 4.4 luna, where i created the web application project as my project is to be deployed on app engine. So when i try to run the project, there is no 'run on server' option to run the project on Tomcat. Please help me, am stuck on …

Member Avatar for Jagdeep_1
0
262
Member Avatar for 47pirates

I'm trying to give access to client computer from my server and also tryin to revoke the granted access... the grant is successful but the revoking is not working please help. hms is the satabase that i want to give access to my clients.. my code try { Connection con …

Member Avatar for stultuske
0
1K
Member Avatar for altjen

Im using NetBeans to create a data entry software for a friend. when I save a data, it create a folder in specified location, and the name of that folder will be different from each other for example. ![1.JPG](/attachments/large/4/e1b8ccbadaaab2f4ef21954288e53b40.JPG "align-center") it pick the Date,Invoice Number, Subject name, and create the …

Member Avatar for altjen
0
270
Member Avatar for liphoso

Please help me with how i may receive an sms to my java application using ozeki. I have used sample code that i got from http://www.ozekisms.com/index.php?owpn=584 , I used that sample code and was able to send sms. Using the same code how may i receive an sms so that …

0
121
Member Avatar for centenond

Im having trouble making the enemy walking intelligence, what road to take to reach the target. So even though i have try this for 3 days, i have no clue what to do now. Say a enemy have a target. and the enemy should aproach it. but i want the …

Member Avatar for Schol-R-LEA
0
170
Member Avatar for Doogledude123

So this is the first time using a Spring Layout and I gotta say, it honestly seems like a very nice Layout to use, but I can't quite seem to get it working the way I want it to. Let me explain: I have a JList which should be inset …

Member Avatar for JamesCherrill
0
300
Member Avatar for Doogledude123

I need a boolean to be stored with a String (or possibly a Path, not sure which one I want to use yet). I thought about using a Map, so I did some looking around and found out that LinkedHashMaps are the only type of Map that stay in Order …

Member Avatar for Slavi
0
292
Member Avatar for Mr.M

Hi Dw. I have a question of how can one detect a program attempting execute/run and also most importantly how to allow/deny programs to execute/run. I'm sure we all have came across with UAC where it ask you to allow or deny that program from running, normally this for elevating …

Member Avatar for Mr.M
0
108
Member Avatar for ilovearsenal

i copied eclipse and its files of code into a new comp. i installed the latest version of java and went into eclipse. i ran the porgram and the code that worked just fine on my previous computer compiled but the applet was blank and it said "start: applet not …

Member Avatar for stultuske
0
139

The End.