Duke dollars

Hello, I have 3 important college assignment that I need help on. I am prepared to pay a fee for. Can anyone help?

The first one is based on JDBC/ODBC

The second on a chat application using client server

The third is based on locales

In case of the first application I have most of it done already. Just having problem gettin resultset working.

I also intend to most of the build on the other ones. Just needing help with them.

I will provide more details once I hear from some-one. Incidentally, how can I send modurlaized files for insepection. It would look very long if posted on this textarea. Finally, how could I earn or purchase Duke dollars in order to reward solutions.?

I thank you in advance

[754 byte] By [sunExpance] at [2007-9-30 20:37:15]
# 1
Buy me a new computer and I'll give you 20 dukes.
RadcliffePike at 2007-7-7 1:26:33 > top of Java-index,Java Essentials,Java Programming...
# 2

If you want "help", then you can get that here free enough. Just post whatever questions you have. Duke$s, or a lack thereof, isn't going to hurt much.

If you want someone to do your work for you, well, sadly, there are probably people around here that would.

Duke$s are not really worth much, since you can't buy things with them. But you earn Duke$s but answering questions and having people reward you.

bsampieri at 2007-7-7 1:26:33 > top of Java-index,Java Essentials,Java Programming...
# 3

Hello, I have developed a modular assignment to access an Access database called "RESPONSE". Within response there is a a table called GetMe. GetMe has a primary key called PHONENUMBER along with records such as phone number email address etc.

The database has been registered in the same directory as the java files.

At present the application only seems to be accessing a string rather than retrieving a record consisting of phone numbers.

The intention is to use the custom made button to retrieve a record within the JTextfield called field.

Gui.java is the GUI file

-import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

class GuiV1 extends JFrame

{

JButton button = new JButton("AddressBook");

JLabel label = new JLabel("Retrieve AddressBook",JLabel.CENTER);

JTextField field= new JTextField();

ButtonListener butListener = new ButtonListener(this);

GuiV1()

{

Container con = getContentPane();

con.setLayout(null);

con.add(button);

con.add(label);

con.add(field);

button.addActionListener(butListener);

button.setBounds(30,110,120,40);

field.setBounds(170,120,200,20);

label.setBounds(150,20,170,40);

setSize(450,350);

setTitle("Data retreival");

setVisible(true);

setResizable(false);

}

}

ButtonListener.java file

--

import java.sql.*;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import javax.swing.JOptionPane;

import java.util.*;

public class ButtonListener extends JFrame implements ActionListener

{

private Connection connection;

private Statement statement;

private ResultSet resultSet;

private ResultSetMetaData rsMetadata;

GuiV1 x;

public ButtonListener(GuiV1 a)

{

x = a;

String url= "jdbc:odbc:Response";

String username = "read";

String password = "pass";

try

{

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

connection=DriverManager.getConnection(url,username,password);

}

catch(ClassNotFoundException cnfex)

{

System.err.println("Failed to load JDBC/ODBC driver");

cnfex.printStackTrace();

System.exit(1);

}

catch(SQLException sqlex)

{

System.err.println("Unable to connect");

sqlex.printStackTrace();

System.exit(1);

}

}// end of constructor

public void actionPerformed(ActionEvent e)

{

if(e.getActionCommand().equals("GetMe"));

{

x.field.setText("SELECT * GetMe");

getTable();

}

}

private void getTable()

{

try

{

String query = x.field.getText();

statement= connection.createStatement();

resultSet=statement.executeQuery(query);

displayresultSet(resultSet);

}

catch(SQLException sqlex)

{

sqlex.printStackTrace();

}

}

private void displayresultSet(ResultSet rs)

throws SQLException

{

boolean moreRecords = rs.next();

if(!moreRecords)

{

JOptionPane.showMessageDialog(this, "Resultset contained no records");

setTitle("No message to display");

return;

}

}

}// end of class

Client program

-

import java.awt.*;

import javax.swing.*;

import java.awt.event.*;

class ClientOne

{

public static void main(String args[])

{

GuiV1 x = new GuiV1();

}

}

sunExpance at 2007-7-7 1:26:33 > top of Java-index,Java Essentials,Java Programming...
# 4

> At present the application only seems to be accessing a string rather than retrieving a record consisting of phone numbers.

Yeah. Well, that made me suspect a problem with your database access code. But when I scrolled through your long, unformatted code I couldn't find any database access code. I would guess that's why you aren't getting anything from the database.

DrClap at 2007-7-7 1:26:33 > top of Java-index,Java Essentials,Java Programming...
# 5
Could you be more specific? The JDBC/ODBC is set up in the listener class, I have also set a string variable for url, password,Do you mean the SQL stuff...? "SELECT TABLE FROM DATABASE_NAME"Yet this is what I am doing. Can you show me solution?
sunExpance at 2007-7-7 1:26:33 > top of Java-index,Java Essentials,Java Programming...
# 6

It is there, Paul, hidden in the getTable() method.

sunExpance in answer to your original question:

> Incidentally, how can I send modurlaized files for insepection. It would look very long if posted on this textarea.

If you have that much code, then having to read it is a strong disincentive to helping you. The best thing to do is to come up with a short piece of code which demonstrates the problem. However, if you are going to post code in here please use [code][/code] tags, as that makes your code legible.

With regard to your problem here, I would advise breaking it down into two halves: the DB access and the UI. First write some code which just accesses the DB and prints i) the exact SQL query; ii) the results to stdout (System.out.println(...)). If you can't get that working, post the code and the output, and if possible post the output of the same query performed within the database's native access environment. Once that's working, then add the GUI.

YATArchivist at 2007-7-7 1:26:33 > top of Java-index,Java Essentials,Java Programming...