Click here to Skip to main content
15,895,557 members

How to save a textbox content into database ?

FoxRoot asked:

Open original thread
Hello everyone.
I have a problem I have searched too much but I can't solve this. I am using netbeans and I have an oracle database. This is my first time to connect an application with a database. Simply, I have a form at netbeans and a table at database.

http://www.imagetoo.com/images/ss1ksk.png[^] In here I have 2 textboxes and a combobox whic has 2 items (administrator and instructor). I want to code under the add button. Namely, I want to save user name password and its role in a table. Here I have created a table.

http://www.imagetoo.com/images/ss2mdm.png[^]

I am noob guys, please help me. If you teach me how to insert I will develop delete update etc.

//UPDATE// here is my button code

Java
try {
      Connection con=null;
      Class.forName("oracle.jdbc.driver.OracleDriver");
      con=DriverManager.getConnection(
        "jdbc:oracle:thin:@AND ALSO HERE:1521:O10G",
        "plsql_staj",
        "plsql_staj1");
      Statement s=con.createStatement();
      s.execute("INSERT INTO E_USER VALUES(""I HAVE PROBLEM HERE")");
      s.close();
      con.close();
   } 
 catch(ClassNotFoundException | SQLException e){}





Thanks.
Tags: Java, Oracle, Text

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900