Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Applet user input to database

Have Programming Question? Ask it here!
 
 
 


Thembekile
user input to database
0 Answer(s)      a year and 7 months ago
Posted in : Applet


/* * Studentinfo2App.java */

package studentinfo2;

import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import org.jdesktop.application.Application; import org.jdesktop.application.SingleFrameApplication; /** * The main class of the application. */ public class Studentinfo2App extends SingleFrameApplication {

/**
 * At startup create and show the main frame of the application.
 */
@Override protected void startup() {
    show(new Studentinfo2View(this));
    ConnectDB();
}

/**
 * This method is to initialize the specified window by injecting resources.
 * Windows shown in our application come fully initialized from the GUI
 * builder, so this additional configuration is not needed.
 */
@Override protected void configureWindow(java.awt.Window root) {
}

/**
 * A convenient static getter for the application instance.
 * @return the instance of Studentinfo2App
 */
public static Studentinfo2App getApplication() {
    return Application.getInstance(Studentinfo2App.class);
}

/**
 * Main method launching the application.
 */
public static void main(String[] args) {
    launch(Studentinfo2App.class, args);
}
Statement Query;
Connection Connector;


private void ConnectDB() {
   String driver = "sun.jdbc.odbc.jdbcodbcDriver";
    String url = "StudentInfo2App.mdb";
    try
    {
        Class.forName(driver);
        Connector = DriverManager.getConnection(url);
        Query = Connector.createStatement();
    }
    catch (Exception ex)
    {

    }

}
 private void Addstudent()
{
    try
    {
        Query.execute("Insert Student;");
    }
    catch (Exception ex)
    {

    }
}
 private int RegisteredStudents(int Id)
{
    try
    {
        ResultSet results = Query.executeQuery("Select Count(*) from Student  Programme = "+ Id + ";");
        return results.getInt(1);
    }
    catch (Exception ex)
    {

    }
    return 0;
}
private void DeleteSTUD(int Id)
{
    try
    {
        Query.execute("Delete Student = " + Id + ";");
    }
    catch (Exception ex)
    {

    }
}


 private int TotalFemales()
{
    try
    {
        ResultSet results = Query.executeQuery("Select the Count(*) from Student Gender = false;");
        return results.getInt(1);
    }
    catch (Exception ex)
    {

    }
    return 0;
}
private int Totalmales()
{
    try
    {
        ResultSet results = Query.executeQuery("Select the Count(*) from Student  Gender = true;");
        return results.getInt(1);
    }
    catch (Exception ex)
    {

    }
    return 0;
}

} could you plz check what is wrong wit my code because in my database user input from my applet does not show...


Advertisement
View Answers

Related Tutorials/Questions & Answers:
user input to database
in my database user input from my applet does not show...user input to database  /* * Studentinfo2App.java */ package studentinfo2; import java.sql.Connection; import java.sql.DriverManager; import
user input to database
in my database user input from my applet does not show...user input to database  /* * Studentinfo2App.java */ package studentinfo2; import java.sql.Connection; import java.sql.DriverManager; import
Advertisements
user input to database
in my database user input from my applet does not show...user input to database  /* * Studentinfo2App.java */ package studentinfo2; import java.sql.Connection; import java.sql.DriverManager; import
escaping user input in php
escaping user input in php  Is it possible to escape the user input while submitting data into database in PHP
button to accept user input
the radiobutton and spinner.The user input does not show on my Studentinfo.mdb... that accepts firstname, lastname and gender from user and insert to database...button to accept user input  private void jButton1ActionPerformed
Java User Input
Java User Input  I am using Scanner class for user Input. Scanner s = new Scanner(System.in); String name = s.next(); but i am unable to store full name in name variable...how i can store full name plsss reply   use
calculation after if. user input
user input????   My apologies good evening peoples Once again I am...calculation after if. user input  System.out.print ("please select...[]args){ Scanner input=new Scanner(System.in); System.out.print
How to read user input in C++
How to read user input in C++  How can i get an input from the users in C++?   You can use the standard input "cin" to get the input from user.. For example: int age; cin >> age
java user input - Java Beginners
java user input  how to input from keyboard? please give a example.  Hi Friend, There are lot of ways to input data from keyboard.You...:****** try{ System.out.print("Enter String:"); BufferedReader input = new
user input in java - Java Beginners
user input in java   i am trying to write a code to compute the average of 5 numbers but i dont know what to do for the program to accept user input  Hi import java.util.*; public class AverageExample { public
error in taking input from user.
error in taking input from user.  //i m having problem inputting the array from user.my program is import java.io.*; class bubble { public static void main(String args[]) { int a[]=new int[20]; int i=0; BufferedReader br=new
How to take input by user using jDialogue and use that input
How to take input by user using jDialogue and use that input  I am... this button a dialogue box appear which take employee_id as input from user . then that input be used for fethcing data from the database ( desired table in DB
Java get User Input
Java get User Input       In this section, you will learn how to get the user input from... that will communicate with the user at the command line and returns the user input. We have
XP Bowling Game User input help
XP Bowling Game User input help  I was asked to do the XP Bowling Example as an assignment. I have the programme passing all tests, but now I need to make the code accept input from a user and display the scores/frames
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening the program. I am developing a college library management system, i would like
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening the program. I am developing a college library management system, i would like
Save the input data until user get changed
Save the input data until user get changed  I would like to know how to store the give input data and perform the calculations even after re-opening the program. I am developing a college library management system, i would like
Write a program that takes the marks of user as input
Write a program that takes the marks of user as input  Write a program that takes the marks of user as input. If marks are greater then 60 the program should display "Great, you have passed the course", else the program should
Managing Multiple User Input Data in an Array (or ArrayList)
Managing Multiple User Input Data in an Array (or ArrayList)  Hey... record alphabetically (2) If user chooses choice1, the input data is stored in an ARRAY (or ARRAYLIST) until the user chooses to stop inputting data. Kindly
Display PHP clock with user input date and time
Display PHP clock with user input date and time  The following PHP code displays a clock with current date and time. I want the clock to receive user input date and time. How can this be done? <?php date<em>
Getting ISD code when user input country name
Getting ISD code when user input country name  I want to create program which user needs by typing Country name he will get ISD code of that country... code, from that list i have to read the file and when user input any country name
input
input  a java program that will exchange the last names of two students that were input by a user
insert user session into other oracle database table
insert user session into other oracle database table   hello i am a doing my project in jsp-servlet. i have doubt that when a user login to his... table. with user id i also want to insert date and current time in to database
Servlet Error Message based on user input
to check the user input against database and display the message to the user. This example illustrate how to ensure that user input is correct by validating...Servlet Error Message based on user input   
Insert image from user using and save in database
Insert image from user using and save in database  when i am trying to upload a image from user and trying to save into oracle9i database.... Apache Tomcat/6.0.29  We have used MySQl database. 1)page.jsp: <
Keyboard Input
Java NotesKeyboard Input There are two approaches to getting keyboard input from the user. GUI (Graphical User Interface). Displaying a graphical text... of the old Teletype machine. Java was designed for graphical user interfaces (GUI
Fetch user records from a table in database
Fetch user records from a table in database  Hi. I have a field in database named stages. its datatype is varchar(60). It contains values chennai,trichy,kanchipuram for a single record. I have to retrieve these data from
Input - Output String Functions
data from a user (text field, text area) since it is not secure to receive a string data and input them directly into your database. Some special characters... Input - Output String Functions      
need help with two dimensional array that takes input from user and bubble sorts and selections sorts
need help with two dimensional array that takes input from user and bubble sorts and selections sorts  I can get both of the sorts figured out but i... how many elements are going to be input by the user?   Here is a code
How to insert image in sql database from user using servlet
How to insert image in sql database from user using servlet  pls tell me accept image from user and insert image in sql server 2005 database using servlet and jsp
simple code to login user & authenticate it from database mysql
simple code to login user & authenticate it from database mysql  Sir, I am creating a login page which contain userid & password. Iwant to authenticate user from mysql database. please tell me the code for it. Thanks
How to view database for user when they login in netbeans and mysql?
How to view database for user when they login in netbeans and mysql?  I create a web page where when user login they have to fill in a form, after... but it come out with all the other user information too. I'm using netbeans and mysql
How to find out the friend user between two columns in sql database
How to find out the friend user between two columns in sql database  Hi, Can any one please tell me ..how to find out the friend user between two columns in sql database? In other words i wanted to get the corresponding data from
how to retreive data from database of a particular user after login
how to retreive data from database of a particular user after login  sir am doing project in ASP.NET useful for my college that is placement portal... to display the details of only current user who logged
how to retreive data from database of a particular user after login
how to retreive data from database of a particular user after login  ... the user information.. now their is a login and registration page for newuser. after the user has filled the form he should go to the welcome page where he
Dialog and Console Input-Output
, but it also gets input from the user. 1 2 3 4 5 6 7 8... that also accepts user input. It returns a string that can be stored... and file input. Of course, your program should eventually have a GUI user
Submit comments in database when user clicks on submit button
Submit comments in database when user clicks on submit button... database when user clicks the submit button of the page. Create a database: First create a database named "usermaster" in MySql and table named "user
Array and input
[ ]={1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26}; i want to ask user to input one of the above numbers then i want to print the array without the number user input. how will i do tht
How to store user name,city,state,image path into database and image into folder using jsp
How to store user name,city,state,image path into database and image into folder using jsp  How to store user name,city,state,image path into database and image into folder using jsp
Change the user input to integer
Change the user input to integer   ... will create a object of a Rectangle class. Now we ask the user to input two values... for an input, then we should use Integer.parseInt(string str).  As we know
User Registration Form Using JSP(JspBeans) after that how i can insert in database
User Registration Form Using JSP(JspBeans) after that how i can insert in database   User Registration Form Using JSP(JspBeans) after that how i can insert in database
input output
input to read the user input.. In this section, you will see how the standard I... Input And Output       Introduction The Java I/O means Java Input/Output and is a part
Servlet question of saving song from database to user's hard disk. - JSP-Servlet
Servlet question of saving song from database to user's hard disk.  I... should be activeted that will read the song from the Oracle database. I have... in the database it should display a save dialog box to select the location where to save
input box
input box  give me the code of input box in core java
input box
input box  give me the code of input box in core java
keyboard input
keyboard input  how do I use JOptionPane to accept keyboard input? I know how to import but not specific command on input line   import javax.swing.*; class JOPtionPaneExample { public static void main(String
input output
input output  java program using fileinputstream and fileoutputstream   Hi Friend, Try the following code: import java.io.*; class FileInputStreamAndFileOutputStream { public static void main(String[] args
input output
input output  java program using fileinputstream and fileoutputstream   Hi Friend, Try the following code: import java.io.*; class FileInputStreamAndFileOutputStream { public static void main(String[] args
Simple input application in Echo3
an application which contains the window from where the user can  input a text and this value would be shown into the content pane when user will click... Simple input application in Echo3   
Develop user registration form
User Registration Form in JSP       In this example we are going to work with a user registration page and saving the data into the database. To store the data in the database
Advertisements
 

 

 

DMCA.com