on 01-02-2011 7:13 AM
Hi all,
I tried to search sample tutorial with oracle database, can any one share the link if you have got.
I am trying to build application with user input and storing in the oracle database.
thanks
just some jdbc programming.
what kind of code you want?
you just get the value from the context, and use jdbc to persist the data, i don't see any difficulty there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
The JDBC connection is already established. I was not able to understand how the input field to be update on the database, say user enters data ,there are 10 input field, which we have to store in context node. and then with insert statement we have to update database , how do we insert the stored context value to database ?
Class.forName("oracle.jdbc.driver.OracleDriver");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
conn = DriverManager.getConnection("jdbc:oracle:thin:@IP:PORT:PORTAL","XYZ","PWD");
stmt = conn.createStatement();
rs = stmt.executeQuery("select * from employee");
String strname = null;
while (rs.next()){
wdComponentAPI.getMessageManager().reportException(rs.getString("ID"),false);
}
ps = conn.prepareStatement("INSERT INTO employee VALUES (value 1,value 2)");
Thank for quick reply
you haven't done any jdbc code?
? means you can put the context value.
please google some basic jdbc tutorial to help you understand the code
try {
con = ds.getConnection("webLogin", "webPassword");
pstmt = con.prepareStatement("UPDATE COFFEES " +
"SET TOTAL = TOTAL + ? WHERE COF_NAME = ?");
pstmt.setInt(1, incr);
pstmt.setString(2, cofName);
pstmt.executeUpdate();
stmt.close();
} finally {
if (con != null) con.close();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.