Navigation Home / Tags / SQL

ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

8
Date Submitted Sun. May. 20th, 2007 4:51 AM
Revision 1
Scripter SecondV
Tags "mysql class" | Database | mysql | SQL
Comments 0 comments
This class is a MySQL database access wrapper. It can:

- Connect to a MySQL server
- Execute SQL queries and retrieve single value results or return result rows into arrays
- Return the last inserted table row identifier, the number of result rows and the number of affected rows
- Count the number of executed queries
- Lock and unlock tables
- Escape text literal values or like patterns
- Retrieve database access errors
10
Date Submitted Thu. Jan. 11th, 2007 9:47 AM
Revision 1
Scripter Casper42
Tags ASPX | SQL | VB.NET
Comments 2 comments
This routine will get an image stored in a SQL database (IBM Informix shown here) as a BLOB and return it to the screen.

To place this on an HTML page simply add

I have an MD5 hashed version as well, but can't share that...(So you can have encrypted id's passed)

Have fun,
Jeremy
5
Date Submitted Mon. Nov. 13th, 2006 8:58 AM
Revision 1
Beginner Mattkins
Tags SQL | VBSCRIPT
Comments 6 comments
This is a quick and dirty function for preventing SQL Injection, the function is designed to clean any variable that will be concatenated into an SQL query. Apostrophes and Double-Quotes are changed to entities in order to ensure that encoding does not become an issue when the content is pulled back into a page. I'm looking for criticism here, I want to know if this is secure or not.
-15
Date Submitted Thu. Oct. 12th, 2006 3:28 PM
Revision 1
Beginner ammonkc
Tags Anti-Injection | Injection | mysql | PHP | SQL
Comments 5 comments
Anti-QSL Injection. I'm sure it could be better, so any improvements are welcome.
4
Date Submitted Sat. Aug. 26th, 2006 10:17 PM
Revision 1
Beginner cf_ernie
Tags "SQL Server" | ColdFusion | SQL
Comments 1 comments
This is a little script I wrote that copies your database through a cfquery statement

Enjoy,
Ernie
ernest.breau@gmail.com
0
Date Submitted Fri. Jul. 21st, 2006 8:37 PM
Revision 1
Helper eriveraa
Tags Server | SQL
Comments 1 comments
This is an example of how to shrink a database with simple query.
-9
Date Submitted Sun. Jul. 16th, 2006 9:16 AM
Revision 1
Helper eriveraa
Tags SQL
Comments 0 comments
Some usefull snippets for SQL Server.
-3
Date Submitted Thu. Feb. 23rd, 2006 9:57 AM
Revision 3
Helper jpinkham
Tags Java | JDBC | lightweight | orm | SQL
Comments 1 comments
I actually like SQL. So, things like Hibernate with it's own query language don't quite fit my style. But, I don't want to code the same catch SQLException conn.close over and over either. So, I came up with this.

The idea is you extend SQLCommand (usually anonymously) override getSql(), and call execute() to get a list of whatever objects you are selecting - all the cleanup stuff is taken care of. It also handles nullable attributes more intuitively using ResultSetWrapper and PreparedStatementWrapper so that in your overridden getRow(ResultSetWrapper rs) method, you can call getInt on a nullable column and have it return null - what a concept! Also I like java.util.Date for my dates, so the wrappers convert to/from java.sql.Timestamp.

Right now I've only bothered with some basic types - it should be pretty clear how to add more if you need em.

See what ya'll think.

Oh, it uses JDK 1.5 Generics, but stripping that away would be pretty easy if you wanted 1.2 compliance.
6
Date Submitted Thu. Nov. 3rd, 2005 7:10 PM
Revision 1
Helper ses5909
Tags "SQL Server" | Portion | SQL | String
Comments 0 comments
Return a Portion of a Character String