this is a formula that isnt operative $( window
).bind("beforeunload",function () { $.ajax({
type: 'POST', async: false, url: "dir",
data: {REMID: ""} }).done(function(msg){alert(msg)});
$.ajax({ type: 'POST', async:
false, url: "dir", data: {REMID: ""}
}); });the "done" duty on a finish of a initial ajax doesnt
arrangement adult and im not certain where the going wrong
Tuesday, 8 April 2014
Friday, 4 April 2014
Cannot insert information into a list in db controlling jdbc
I have a problem to insert a new quarrel of information into a list we
combined around JDBC. It throws SQLException after a ExecuteUpdate()
line.Below we yield a formula that combined a DB and a Table in this DB.
The second partial has a formula that is ostensible to insert values into
quarrel in a PatientsData table.public category DbSetUp {private
stationary Connection con;private stationary String mySqlString = "CREATE
TABLE PatientsData" + "(id INTEGER PRIMARY KEY," + "fname
VARCHAR(30) NOT NULL," + "lname VARCHAR(30) NOT NULL," +
"sex VARCHAR(1) NOT NULL," + "insurance VARCHAR(1) NOT NULL," +
"profession VARCHAR(30) NOT NULL)";//private boolean end;private
stationary String strTemp = "CREATE TABLE PatientsTemp" + "(id
INTEGER PRIMARY KEY," + "name VARCHAR(256) NOT NULL," +
"date DATE NOT NULL," + "temp NUMERIC NOT NULL)";public stationary
vacant main(String[] args) { try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); } locate
(ClassNotFoundException e) { System.out.println("Driver not
found"); e.printStackTrace(); } try { rapist =
DriverManager.getConnection("jdbc:derby:PatientDb;create=true"); }
locate (SQLException e) { System.out.println("Db not found");
e.printStackTrace(); } Statement matter = null; try{
matter = con.createStatement(); statement.execute(mySqlString);
statement.execute(strTemp); } catch(SQLException ex){
ex.printStackTrace(); }}The above formula works glorious throwing no
exceptions. we assume that both tables have been combined and a DB
exists:)Not a partial that is ostensible to insert data:public Patient
createNewPatient(int id, String fname, String lname, String sex,
String insurance, String profession) { try {
DriverManager.registerDriver(new org.apache.derby.jdbc.EmbeddedDriver());
} locate (SQLException e1) { System.out.println("to na
poczatku"); e1.printStackTrace(); } try{ rapist =
DriverManager.getConnection("jdbc:derby:PatientDb");
PreparedStatement ps = con.prepareStatement("INSERT INTO PatientsData
VALUES(?,?,?,?,?,?)"); System.out.println("Prepared Statement");
ps.setInt(1, id); System.out.println("set int id");
ps.setString(2, fname); ps.setString(3,lname);
ps.setString(4,sex); ps.setString(5, insurance);
ps.setString(6,profession); System.out.println("set twine
profession"); outcome = ps.executeUpdate();
System.out.println(result); relapse new
Patient(id,fname,lname,sex,insurance,profession);
//System.out.println("set twine profession"); } catch(SQLException e){
System.out.println("SQL exception"); relapse null; }}The
line: outcome = ps.executeUpdate(); throws SQLException, we have no
thought where is a mistake. we have total derby.jar into my build path.
combined around JDBC. It throws SQLException after a ExecuteUpdate()
line.Below we yield a formula that combined a DB and a Table in this DB.
The second partial has a formula that is ostensible to insert values into
quarrel in a PatientsData table.public category DbSetUp {private
stationary Connection con;private stationary String mySqlString = "CREATE
TABLE PatientsData" + "(id INTEGER PRIMARY KEY," + "fname
VARCHAR(30) NOT NULL," + "lname VARCHAR(30) NOT NULL," +
"sex VARCHAR(1) NOT NULL," + "insurance VARCHAR(1) NOT NULL," +
"profession VARCHAR(30) NOT NULL)";//private boolean end;private
stationary String strTemp = "CREATE TABLE PatientsTemp" + "(id
INTEGER PRIMARY KEY," + "name VARCHAR(256) NOT NULL," +
"date DATE NOT NULL," + "temp NUMERIC NOT NULL)";public stationary
vacant main(String[] args) { try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); } locate
(ClassNotFoundException e) { System.out.println("Driver not
found"); e.printStackTrace(); } try { rapist =
DriverManager.getConnection("jdbc:derby:PatientDb;create=true"); }
locate (SQLException e) { System.out.println("Db not found");
e.printStackTrace(); } Statement matter = null; try{
matter = con.createStatement(); statement.execute(mySqlString);
statement.execute(strTemp); } catch(SQLException ex){
ex.printStackTrace(); }}The above formula works glorious throwing no
exceptions. we assume that both tables have been combined and a DB
exists:)Not a partial that is ostensible to insert data:public Patient
createNewPatient(int id, String fname, String lname, String sex,
String insurance, String profession) { try {
DriverManager.registerDriver(new org.apache.derby.jdbc.EmbeddedDriver());
} locate (SQLException e1) { System.out.println("to na
poczatku"); e1.printStackTrace(); } try{ rapist =
DriverManager.getConnection("jdbc:derby:PatientDb");
PreparedStatement ps = con.prepareStatement("INSERT INTO PatientsData
VALUES(?,?,?,?,?,?)"); System.out.println("Prepared Statement");
ps.setInt(1, id); System.out.println("set int id");
ps.setString(2, fname); ps.setString(3,lname);
ps.setString(4,sex); ps.setString(5, insurance);
ps.setString(6,profession); System.out.println("set twine
profession"); outcome = ps.executeUpdate();
System.out.println(result); relapse new
Patient(id,fname,lname,sex,insurance,profession);
//System.out.println("set twine profession"); } catch(SQLException e){
System.out.println("SQL exception"); relapse null; }}The
line: outcome = ps.executeUpdate(); throws SQLException, we have no
thought where is a mistake. we have total derby.jar into my build path.
Tuesday, 1 April 2014
For Loop Table in PHP
I am perplexing to beget a list with php for loop, that lists numbers.
Something like this:1 | 2 | 3 | 4 | 52 | 3 | 4 | 5 | 13 | 4 | 5 | 1 | 24 |
5 | 1 | 2 | 35 | 1 | 2 | 3 | 4I still have problems removing it, this is
indeed definitely simple, though we have not been means to solve it. So
distant we have a following code:";for ($row = 0; $row < 5; $row ++) {
relate ""; for ($col = 1; $col <= 4; $col ++) { relate "", ($col
+ ($row * 4)), ""; } relate "";}echo "";?>However, this wholly
generates a following:1 | 2 | 3 | 4 5 | 6 | 7 | 89 | 10 | 11 | 1213
| 14 | 15 | 1617 | 18 | 19 | 20Thank you, any assistance would be
appreciated!
Something like this:1 | 2 | 3 | 4 | 52 | 3 | 4 | 5 | 13 | 4 | 5 | 1 | 24 |
5 | 1 | 2 | 35 | 1 | 2 | 3 | 4I still have problems removing it, this is
indeed definitely simple, though we have not been means to solve it. So
distant we have a following code:";for ($row = 0; $row < 5; $row ++) {
relate ""; for ($col = 1; $col <= 4; $col ++) { relate "", ($col
+ ($row * 4)), ""; } relate "";}echo "";?>However, this wholly
generates a following:1 | 2 | 3 | 4 5 | 6 | 7 | 89 | 10 | 11 | 1213
| 14 | 15 | 1617 | 18 | 19 | 20Thank you, any assistance would be
appreciated!
Subscribe to:
Comments (Atom)