request for very simple SQL extension
Posted: 06 Jun 2011, 18:56
can any one give a very simple code snippet that:
conects to an SQL server
querys and a data value
all help is apreciated
ive tryed the following which dosnt seam to work

conects to an SQL server
querys and a data value
all help is apreciated
ive tryed the following which dosnt seam to work
Code: Select all
IDBManager dbManager = getParentExtension().getParentZone().getDBManager();
Connection connection;
try {
connection = dbManager.getConnection();
PreparedStatement stmt = connection.prepareStatement("SELECT pword,id FROM muppets WHERE name=Kermit");
ResultSet res = stmt.executeQuery();
dbPword = res.getString("pword");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}