Inserting blob images in a database
Hi there can anyone tell me how to insert a blob image into a table; can you actually give me an example
thanks
use DBMS_LOB.LOADFROMFILE.
PROCEDURE LOADFROMFILE
Argument Name Type In/Out Default?
DEST_LOB BLOB IN/OUT
SRC_LOB BINARY FILE LOB IN
AMOUNT NUMBER(38) IN
DEST_OFFSET NUMBER(38) IN DEFAULT
SRC_OFFSET NUMBER(38) IN DEFAULT
Similar Messages
-
Insert an image from a Database
Hi - I am trying to insert an image from a database into a webpage. Basically when clients register on the site they upload their logo which i want to come up when they look at their account details and when they post a job. When I test the file upload the file name is in an "image" field in my database and the image is in the website files on the server but I am having problems trying to get the logo to shop up on the webpage. I have one table called Recruiters where all the client's contact details (and logo upload goes) and a table called jobs where all the job details go when they post a job (this does not hold the logo upload).
At the moment i am trying to insert the image into the Recruiter account Details page where all the clients contact details are and all this information comes from the Recruiter table (including the image) but the image does not appear. the query in my recordset is:-
SELECT *
FROM recruiters
WHERE RecruiterID = colname
(colname = $_GET['RecruiterID'])
<?php require_once('../Connections/laura.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
$logoutGoTo = "../index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
?>
<?php
if (!isset($_SESSION)) {
session_start();
$MM_authorizedUsers = "Recruiter";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
if (($strUsers == "") && false) {
$isValid = true;
return $isValid;
$MM_restrictGoTo = "../Unavailablepage.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$colname_rsAccountDetails = "-1";
if (isset($_GET['RecruiterID'])) {
$colname_rsAccountDetails = $_GET['RecruiterID'];
mysql_select_db($database_laura, $laura);
$query_rsAccountDetails = sprintf("SELECT * FROM recruiters WHERE RecruiterID = %s", GetSQLValueString($colname_rsAccountDetails, "int"));
$rsAccountDetails = mysql_query($query_rsAccountDetails, $laura) or die(mysql_error());
$row_rsAccountDetails = mysql_fetch_assoc($rsAccountDetails);
$totalRows_rsAccountDetails = mysql_num_rows($rsAccountDetails);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Nursery and Childcare Jobs in the UK</title>
<link href="../CSS/Global.css" rel="stylesheet" type="text/css" />
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<!-- google adwords -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6435415-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
</script>
</head>
<body>
<div class="container">
<div class="header"><!-- end .header --><a href="../index.php"><img src="../Images/Logo.png" width="900" height="200" alt="Logo" /></a></div>
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="../index.php">Home</a> </li>
<li><a href="#" class="MenuBarItemSubmenu">Recruiters</a>
<ul>
<li><a href="recruiterbenefits.php">Benefits</a></li>
<li><a href="recruiterfees.php">Fees</a></li>
<li><a href="recreg.php">Register</a></li>
<li><a href="reclogin.php">Login </a></li>
</ul>
</li>
<li><a class="MenuBarItemSubmenu" href="#">Jobseekers</a>
<ul>
<li><a href="../Jobseekerarea/jobseekerbenefits.php">Benefits</a> </li>
<li><a href="../Jobseekerarea/jobseekerreg1.php">Register</a></li>
<li><a href="../Jobseekerarea/jslogin.php">Login</a></li>
</ul>
</li>
<li><a href="../contactus.php">Contact Us</a></li>
</ul>
<div class="sidebar1">
<p> </p>
<div class="recruitsidebar">
<ul id="MenuBar2" class="MenuBarVertical">
<li><a href="postajob.php">Post a Job</a></li>
<li><a href="recruiterjobs1.php">My Jobs</a></li>
<li><a href="recAccdetails.php?RecruiterID=<?php echo $row_rsAccountDetails['RecruiterID']; ?>">My Details</a></li>
<li><a href="Saferrecruitment.php">Safer Recruitment</a></li>
<li><a href="Interview1.php" class="MenuBarItemSubmenu">Interviewing Staff</a>
<ul>
<li><a href="recInterviewquestions.php">Nursery Staff Interview Questions</a></li>
</ul>
</li>
<li><a href="Nurseryjobsdescriptions.php">Nursery Job Descriptions</a></li>
<li><a href="recruiterarea.php">Recruiter Home</a></li>
<li><a href="<?php echo $logoutAction ?>">Log Out</a></li>
</ul>
<p> </p>
</div>
</div>
<div class="content">
<h1>Account Details</h1>
<p>Below are the details you have provided us with about your nursery/setting.</p>
<p> </p>
<form id="accountdetailsform" name="accountdetailsform" method="post" action="recUpdate.php?RecruiterID=<?php echo $row_rsAccountDetails['RecruiterID']; ?>">
<table width="580" border="0" cellpadding="3" cellspacing="3" id="accountdetails">
<tr>
<td width="212" scope="col">Nursery/Setting Name</td>
<td width="347" scope="col"><?php echo $row_rsAccountDetails['client']; ?></td>
</tr>
<tr>
<td>Contact Name</td>
<td><?php echo $row_rsAccountDetails['contactname']; ?></td>
</tr>
<tr>
<td>Setting Type</td>
<td><?php echo $row_rsAccountDetails['settingtype']; ?></td>
</tr>
<tr>
<td>Nursery/Setting</td>
<td><?php echo $row_rsAccountDetails['Setting']; ?></td>
</tr>
<tr>
<td>Building Name/Number</td>
<td><?php echo $row_rsAccountDetails['buildingnumber']; ?></td>
</tr>
<tr>
<td>Street Name</td>
<td><?php echo $row_rsAccountDetails['streetname']; ?></td>
</tr>
<tr>
<td>Address</td>
<td><?php echo $row_rsAccountDetails['address3']; ?></td>
</tr>
<tr>
<td>Town/City</td>
<td><?php echo $row_rsAccountDetails['town']; ?></td>
</tr>
<tr>
<td>Post Code</td>
<td><?php echo $row_rsAccountDetails['postcode']; ?></td>
</tr>
<tr>
<td>Region</td>
<td><?php echo $row_rsAccountDetails['region']; ?></td>
</tr>
<tr>
<td>Telephone</td>
<td><?php echo $row_rsAccountDetails['telephone']; ?></td>
</tr>
<tr>
<td>Email</td>
<td><?php echo $row_rsAccountDetails['email']; ?></td>
</tr>
<tr>
<td>Website</td>
<td><?php echo $row_rsAccountDetails['WebAddress']; ?></td>
</tr>
<tr>
<td>Password</td>
<td> </td>
</tr>
<tr>
<td>Logo</td>
<td><img src="<?php echo $row_rsAccountDetails['Image']; ?>" alt="Logo" /></td>
</tr>
<tr>
<td>Date Registered</td>
<td><?php echo $row_rsAccountDetails['dateregistered']; ?></td>
</tr>
</table>
<p>
<input name="hiddenField" type="hidden" id="hiddenField" value="<?php echo $row_rsAccountDetails['RecruiterID']; ?>" />
</p>
<p>
<input type="submit" name="Update" id="Update" value="Update Details" />
</p>
<p> </p>
</form>
<p> </p>
<table width="600" border="0" cellpadding="3" cellspacing="3" class="postform">
<tr> </tr>
<tr> </tr>
<tr> </tr>
</table>
<p> </p>
<p> </p>
</div>
<div class="sidebar2">
<h4> </h4>
<!-- end .sidebar2 --></div>
<div class="footer">
<p><a href="../index.php">Home</a> | <a href="../contactus.php">Contact us</a> | <a href="../PrivacyPolicy.php">Privacy</a> | <a href="../termsandconditions.php">Terms of Business</a></p>
<p>© theNurseryJobSite.com 2011</p>
<!-- end .footer --></div>
<!-- end .container --></div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
<?php
mysql_free_result($rsAccountDetails);
?>Hi
You were right – I had to insert full path and it has worked so thanks.
Would you be able to help me out with inserting the logo into a job post page and the recordset I will need to insert the logo?
Basically I want to add the logo that is uploaded when a client registers on the site onto a job info page. To access the the details about a job, jobseekers just click on the job that interests them which takes them to the job details page which pulls all the information from the "Job" table in the database. However, the logo is stored in the "image" field in the "Recruiter" table in the database. I have tried setting up a recordset as:-
SELECT Image
FROM recruiters
WHERE RecruiterID = colname
(colname = $_GET['RecruiterID'])
<?php require_once('../Connections/laura.php'); ?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
$logoutGoTo = "../index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
?>
<?php
if (!isset($_SESSION)) {
session_start();
$MM_authorizedUsers = "Recruiter";
$MM_donotCheckaccess = "false";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
if (($strUsers == "") && false) {
$isValid = true;
return $isValid;
$MM_restrictGoTo = "../Unavailablepage.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$colname_rsDetails = "-1";
if (isset($_GET['JobID'])) {
$colname_rsDetails = $_GET['JobID'];
mysql_select_db($database_laura, $laura);
$query_rsDetails = sprintf("SELECT * FROM jobs WHERE JobID = %s", GetSQLValueString($colname_rsDetails, "text"));
$rsDetails = mysql_query($query_rsDetails, $laura) or die(mysql_error());
$row_rsDetails = mysql_fetch_assoc($rsDetails);
$totalRows_rsDetails = "-1";
if (isset($_GET['JobID'])) {
$totalRows_rsDetails = $_GET['JobID'];
mysql_select_db($database_laura, $laura);
$query_rsDetails = sprintf("SELECT recruiters.Image, jobs.JobID, jobs.RecruiterID, jobs.jobtitle, jobs.`Position`, jobs.Nursery, jobs.branchlocation, jobs.ContactName, jobs.JobDescription, jobs.Location, jobs.town, jobs.employmenttype, jobs.Hours, jobs.qualifications, jobs.Salary, jobs.ContactNo, jobs.Email, jobs.dateposted FROM jobs, recruiters WHERE JobID = %s", GetSQLValueString($colname_rsDetails, "int"));
$rsDetails = mysql_query($query_rsDetails, $laura) or die(mysql_error());
$row_rsDetails = mysql_fetch_assoc($rsDetails);
$totalRows_rsDetails = "-1";
if (isset($_GET['JobID'])) {
$totalRows_rsDetails = $_GET['JobID'];
mysql_select_db($database_laura, $laura);
$query_rsDetails = sprintf("SELECT recruiters.Image, jobs.JobID, jobs.RecruiterID, jobs.jobtitle, jobs.`Position`, jobs.Nursery, jobs.branchlocation, jobs.ContactName, jobs.JobDescription, jobs.Location, jobs.town, jobs.employmenttype, jobs.Hours, jobs.qualifications, jobs.Salary, jobs.ContactNo, jobs.Email, jobs.dateposted FROM jobs, recruiters WHERE JobID = %s", GetSQLValueString($colname_rsDetails, "int"));
$rsDetails = mysql_query($query_rsDetails, $laura) or die(mysql_error());
$row_rsDetails = mysql_fetch_assoc($rsDetails);
$totalRows_rsDetails = "-1";
if (isset($_GET['JobID'])) {
$totalRows_rsDetails = $_GET['JobID'];
mysql_select_db($database_laura, $laura);
$query_rsDetails = sprintf("SELECT recruiters.Image, jobs.JobID, jobs.RecruiterID, jobs.jobtitle, jobs.`Position`, jobs.Nursery, jobs.branchlocation, jobs.ContactName, jobs.JobDescription, jobs.Location, jobs.town, jobs.employmenttype, jobs.Hours, jobs.qualifications, jobs.Salary, jobs.ContactNo, jobs.Email, jobs.dateposted FROM jobs, recruiters WHERE JobID = %s", GetSQLValueString($totalRows_rsDetails, "int"));
$rsDetails = mysql_query($query_rsDetails, $laura) or die(mysql_error());
$row_rsDetails = mysql_fetch_assoc($rsDetails);
$totalRows_rsDetails = mysql_num_rows($rsDetails);
$colname_rsRecruiterID2 = "-1";
if (isset($_GET['RecruiterID'])) {
$colname_rsRecruiterID2 = $_GET['RecruiterID'];
mysql_select_db($database_laura, $laura);
$query_rsRecruiterID2 = sprintf("SELECT RecruiterID FROM recruiters WHERE RecruiterID = %s", GetSQLValueString($colname_rsRecruiterID2, "int"));
$rsRecruiterID2 = mysql_query($query_rsRecruiterID2, $laura) or die(mysql_error());
$row_rsRecruiterID2 = mysql_fetch_assoc($rsRecruiterID2);
$totalRows_rsRecruiterID2 = mysql_num_rows($rsRecruiterID2);
$colname_rsRecruiterID = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rsRecruiterID = $_SESSION['MM_Username'];
mysql_select_db($database_laura, $laura);
$query_rsRecruiterID = sprintf("SELECT RecruiterID FROM recruiters WHERE email = %s", GetSQLValueString($colname_rsRecruiterID, "text"));
$rsRecruiterID = mysql_query($query_rsRecruiterID, $laura) or die(mysql_error());
$row_rsRecruiterID = mysql_fetch_assoc($rsRecruiterID);
$totalRows_rsRecruiterID = mysql_num_rows($rsRecruiterID);
$colname_Recordset1 = "-1";
if (isset($_GET['RecruiterID'])) {
$colname_Recordset1 = $_GET['RecruiterID'];
mysql_select_db($database_laura, $laura);
$query_Recordset1 = sprintf("SELECT Image FROM recruiters WHERE RecruiterID = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $laura) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$query_rsJobs = "SELECT * FROM jobs";
$rsJobs = mysql_query($query_rsJobs, $laura) or die(mysql_error());
$row_rsJobs = mysql_fetch_assoc($rsJobs);
$totalRows_rsJobs = mysql_num_rows($rsJobs);
$colname_rsJobs = "-1";
if (isset($_GET['Position'])) {
$colname_rsJobs = $_GET['Position'];
$varLocation_rsJobs = "-1";
if (isset($_GET['Location'])) {
$varLocation_rsJobs = $_GET['Location'];
mysql_select_db($database_laura, $laura);
$query_rsJobs = sprintf("SELECT `Position`, Nursery, Location, Salary, Email, ContactNo, JobDescription, JobID FROM jobs WHERE `Position` = %s AND jobs.Location = %s", GetSQLValueString($colname_rsJobs, "text"),GetSQLValueString($varLocation_rsJobs, "text"));
$rsJobs = mysql_query($query_rsJobs, $laura) or die(mysql_error());
$row_rsJobs = mysql_fetch_assoc($rsJobs);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Nursery and Childcare Jobs in the UK</title>
<link href="../CSS/Global.css" rel="stylesheet" type="text/css" />
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<!-- google adwards -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-6435415-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
</script>
</head>
<body>
<div class="container">
<div class="header"><!-- end .header --><a href="../index.php"><img src="../Images/Logo.png" width="900" height="200" alt="the Nursery Job Site" /></a></div>
<div class="navbar"> <ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="thenurseryjobsite.php">About the Nursery Job Site</a> </li>
<li><a href="#" class="MenuBarItemSubmenu">Recruiters</a>
<ul>
<li><a href="Recruiterarea/recruiterbenefits.php">Benefits</a></li>
<li><a href="Recruiterarea/recruiterfees.php">Fees</a></li>
<li><a href="Recruiterarea/reclogin.php">Login</a></li>
<li><a href="Recruiterarea/recreg.php">Register</a></li>
</ul>
</li>
<li><a class="MenuBarItemSubmenu" href="#">Jobseekers</a>
<ul>
<li><a href="Jobseekerarea/jobseekerbenefits.php">Benefits</a> </li>
<li><a href="Jobseekerarea/jslogin.php">Login</a></li>
<li><a href="Jobseekerarea/jobseekerreg1.php">Register</a></li>
</ul>
</li>
<li><a href="contactus.php">Contact Us</a></li>
</ul> </div> <!--end navbar div -->
<div class="sidebar1">
<p> </p>
<div class="recruitsidebar">
<ul id="MenuBar2" class="MenuBarVertical">
<li><a href="postajob.php">Post a Job</a></li>
<li><a href="recAccdetails.php?RecruiterID=<?php echo $row_rsRecruiterID['RecruiterID']; ?>">My Details </a></li>
<li><a href="recruiterjobs1.php">My Jobs</a></li>
<li><a href="Saferrecruitment.php">Safer Recruitment</a></li>
<li><a href="Interview1.php" class="MenuBarItemSubmenu">Interviewing Staff</a>
<ul>
<li><a href="recInterviewquestions.php">Nursery Staff Interview Questions</a></li>
</ul>
</li>
<li><a href="Nurseryjobsdescriptions.php">Nursery Job Descriptions</a></li>
<li><a href="recruiterarea.php">Recruiter Home</a></li>
<li><a href="<?php echo $logoutAction ?>">Log Out</a></li>
</ul>
<p> </p>
</div>
</div>
<div class="content">
<h1> </h1>
<div class="detailheading" id="detailheading">
<h1> </h1>
<table width="564" border="0" align="center" cellpadding="3" cellspacing="3" id="headingtable">
<tr>
<td width="89" height="44" align="center" class="headertext"><h1>Nursery:</h1></td>
<td width="283" class="headertext"><?php echo $row_rsDetails['Nursery']; ?></td>
<td width="162" rowspan="2"><img src="<?php echo $row_Recordset1['Image']; ?>" alt="" name="nurserylogo" align="right" id="nurserylogo" /></td>
</tr>
<tr align="left" class="headertext">
<td width="89" height="44" align="center"><h1 class="headertext">Job Title:</h1></td>
<td align="left"><?php echo $row_rsDetails['jobtitle']; ?></td>
</tr>
</table>
<p> </p>
</div>
<table width="568" border="0" align="center" cellpadding="3" cellspacing="3" class="detail" id="detailtable">
<tr>
<td width="162" scope="col">Job Title</td>
<td width="381" scope="col"><?php echo $row_rsDetails['jobtitle']; ?></td>
</tr>
<tr>
<td>Nursery</td>
<td><?php echo $row_rsDetails['Nursery']; ?></td>
</tr>
<tr>
<td>Branch Name/Location</td>
<td><?php echo $row_rsDetails['branchlocation']; ?></td>
</tr>
<tr>
<td>Location</td>
<td><?php echo $row_rsDetails['Location']; ?>,<?php echo $row_rsDetails['town']; ?></td>
</tr>
<tr>
<td valign="top">Job Description</td>
<td><p> </p>
<p><?php echo $row_rsDetails['JobDescription']; ?></p>
<p> </p></td>
</tr>
<tr>
<td>Qualifications Required</td>
<td><?php echo $row_rsDetails['qualifications']; ?></td>
</tr>
<tr>
<td>Employment Type</td>
<td><?php echo $row_rsDetails['employmenttype']; ?></td>
</tr>
<tr>
<td>Hours</td>
<td><?php echo $row_rsDetails['Hours']; ?></td>
</tr>
<tr>
<td>Salary</td>
<td>£<?php echo $row_rsDetails['Salary']; ?></td>
</tr>
<tr>
<td>Contact Number</td>
<td><?php echo $row_rsDetails['ContactNo']; ?></td>
</tr>
<tr>
<td>Email</td>
<td><?php echo $row_rsDetails['Email']; ?></td>
</tr>
<tr>
<td>Date Posted</td>
<td><?php echo $row_rsDetails['dateposted']; ?></td>
</tr>
<tr>
<td>Job ID</td>
<td><?php echo $row_rsDetails['JobID']; ?></td>
</tr>
</table>
<p><br />
</p>
<form id="recruiterjobsform" name="recruiterjobsform" method="post" action="recruiterjobs1.php">
<input name="RecruiterIDjobs" type="hidden" id="RecruiterIDjobs" value="<?php echo $row_rsDetails['RecruiterID']; ?>" />
<input type="submit" name="button" id="button" value="return to my jobs" />
</form>
<p> </p>
<script type="text/javascript">
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
</script><script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
</script>
<p> </p>
</div>
<div class="sidebar2">
<h4> </h4>
<!-- end .sidebar2 --></div>
<div class="footer">
<p><a href="../index.php">Home</a> | <a href="../contactus.php">Contact us</a> | <a href="../PrivacyPolicy.php">Privacy</a> | <a href="../termsandconditions.php">Terms of Business</a></p>
<p>© theNurseryJobSite.com 2011</p>
<!-- end .footer --></div>
<!-- end .container --></div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>
<?php
mysql_free_result($rsDetails);
mysql_free_result($rsRecruiterID2);
mysql_free_result($rsRecruiterID);
mysql_free_result($Recordset1);
?> -
Inserting Multiple Images into oracle database using JDBC
I wanted to insert multiple images into database using JDBC by reading it from the file... and i am passing photos.txt(my text file) as an input parameter... I have inserted all the values into the database except for the image part... this is my content of photos.txt file and i have copied all the images into the folder
*" C:\\photos "*
*1,in1.jpg,108,19,in-n-out*
*2,in2.jpg,187,21,in-n-out*
*3,in3.jpg,308,41,in-n-out*
*4,in4.jpg,477,52,in-n-out*
*5,in5.jpg,530,50,in-n-out*
and i want to store in1.jpg,in2.jpg,in3.jpg,in4.jpg,in5.jpg into the oracle databse using JDBC.... i have tried a lot using BLOB column.... and i have created my table as
CREATE TABLE PHOTO(
ID NUMBER NOT NULL PRIMARY KEY ,
Name BLOB,
X DOUBLE PRECISION,
Y DOUBLE PRECISION,
Tags VARCHAR2(40)
try { // for restaurant System.out.println();System.out.println();System.out.println(); System.out.print(" Creating Statement for Photo...\n"); stmt2 = con.createStatement (); stmt2.executeUpdate("delete from PHOTO"); stmt2.executeUpdate("commit"); PreparedStatement stmt3 = con.prepareStatement ("INSERT INTO PHOTO VALUES (?, ?, ?, ?, ?)"); System.out.print(" Create FileReader Object for file: " + inputFileName1 + "...\n"); FileReader inputFileReader2 = new FileReader(inputFileName1); System.out.print(" Create BufferedReader Object for FileReader Object...\n"); BufferedReader inputStream2 = new BufferedReader(inputFileReader2); String inLine2 = null; String[] tokens; // String[] imageFilenames = {"c:\\photos\\in1.jpg","c:\\photos\\in2.jpg","c:\\photos\\in3.jpg","c:\\photos\\in4.jpg","c:\\photos\\in5.jpg", // "c:\\photos\\in6.jpg","c:\\photos\\in7.jpg","c:\\photos\\in8.jpg","c:\\photos\\in9.jpg","c:\\photos\\in10.jpg","c:\\photos\\arb1.jpg","c:\\photos\\arb2.jpg", // "c:\\photos\\arb3.jpg","c:\\photos\\arb4.jpg","c:\\photos\\arb5.jpg","c:\\photos\\den1.jpg","c:\\photos\\den2.jpg","c:\\photos\\den3.jpg", // "c:\\photos\\den4.jpg","c:\\photos\\den5.jpg","c:\\photos\\hop1.jpg","c:\\photos\\hop2.jpg","c:\\photos\\hop3.jpg","c:\\photos\\hop4.jpg","c:\\photos\\hop5.jpg"}; File file = new File("C:\\photos\\in1.jpg"); \\ ( Just for example ) FileInputStream fs = new FileInputStream(file); while ((inLine2 = inputStream2.readLine()) != null) { tokens= inLine2.split(","); st2 = new StringTokenizer(inLine2, DELIM); stmt3.setString(1, tokens[0]); stmt3.setBinaryStream(2, fs, (int)(file.length())); stmt3.setString(3, tokens[2]); stmt3.setString(4, tokens[3]); stmt3.setString(5, tokens[4]); stmt3.execute(); //execute the prepared statement stmt3.clearParameters();
As i am able to enter one image file by above code in1.jpg in to the oracle database.... but i am not able to insert all the image file in to the database.....do tell me what should i do.... and can you give me the example on the basis of the above code of mine...
do reply as soon as possible..jwenting wrote:
that depends. Putting the images in BLOBs prevents the file locations stored in the database from getting out of synch with the filesystem when sysadmins decide to reorganise directory structures or "archive" "old" files that noone uses anyway.True, but it really comes down to a business decision (cost-benefit analysis). If you have the bucks, the expertise, and the time, go with the Blobs, otherwise go with the flat files. -
Error while inserting BLOB value in the database
I am trying to insert a BLOB value in the database. This action results in the following exception:
java.sql.SQLException: ORA-22925: operation would exceed maximum size allowed for a LOB value
The method i am using is as follows:
public void insertBlob(Connection Con, StringBuffer Message)throws SQLException
String Query = "INSERT INTO MSGBLOCKS (MSGDB_ID, MSGBLOCKTYPE, MESSAGE) VALUES (20, 1 , ?)";
PreparedStatement PS = Con.prepareStatement(Query);
byte[] bytes = new String(Message).getBytes();
ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
PS.setBinaryStream(1, bi, bytes.length);
PS.executeUpdate();
The manifest file of ojdbc14.jar being used is: 10.1.0.5.0 and I am using jdk 1.4.
Also the message being tried to insert is of 9 Kb only.
Any help would be greatly appreciated.
Thanks!!!Did you check if the Message is having only that small 9kb of data? also check the maximum allowed size for that column in the Oracle DB, the size can be restricted to 8Kb also.
Edited by: DynamicBasics on Jul 28, 2010 5:54 PM -
Insert large Image object into Database
Hello
I have a large (!MB) image which needs to be stored in a database BLOB column, and I'm running out of memory with my naive code..
Nothing other than the code is within my control. I cannot change my heap size; I have no file-system, so cannot write the image.
The awt.Image is created and drawn elsewhere in the application. My thought was to create a byte stream and have that inserted chunk-by-chunk, but I just can't find out how to do this in a limited time.
Any help would be much appreciated.
Leeleegee23 wrote:
Thanks for your help. Have tried this:
ImageInputStream is = ImageIO.createImageInputStream(gif);But got null. The docs read:
Returns an ImageInputStream that will take its input from the given Object. The set of ImageInputStreamSpis registered with the IIORegistry class is queried and the first one that is able to take input from the supplied object is used to create the returned ImageInputStream. If no suitable ImageInputStreamSpi exists, null is returned.
Am I barking up the wrong tree?I think you're on the right track. A quick browse found that an ImageWriter (GIFImageWriter) can be used to write an image to an output stream (use ImageIO.createImageOutputStream()), and then you can probably use PipedInputStream/PipedOutputStream to obtain an inputStream that you can pass to your JDBC driver to store the blob.
That's just from reading Javadocs though, I'm not sure how to connect the dots.
And also, make sure you post a reference to this thread on the new one you created. You wouldn't want people to waste time answering that thread if there's an answer here already, or vice versa.
Edit: I was thinking specifically of using a GifImageWriter constructed with a OutputStreamImageOutputStreamSpi that was passed in a PipedOutputStream which you would in turn connect to a PipedInputStream which you would pass in to the JDBC method.
But I'm not sure, it looks like even then it either uses a memory cache or a file cache. When you have compression, the writer will typically need to have access to all the bytes of the image before starting to write. It would be a two-pass algorithm, most likely. Which basically means you might have memory issues anyway.
Edited by: endasil on 22-Sep-2009 1:12 PM -
Inserting blob image into table
ora.gif, image001.jpeg are the image names .these are stored in the location D:\oracle\Bfiles
create directory BFILE_FILES as ‘D:\oracle\Bfiles';
i want to insert the 2 images into table using blob
how to create the table and how to insert and how to test that image is inserted or notTom Kyte has it all Here
-
I unsuccessfully tried to find way to insert embedded image into TextArea via <img> tag. Can you point me out how to do this?
Also, please, tell me how to handle IOErrorEvent from TextArea because adding IOErrorEvent.IO_ERROR listener to TextArea doesn't cause any effect when image url of img tag has not been found.
Thanksi 've successfully inserted the image into the database... here is my code
* To change this template, choose Tools | Templates
* and open the template in the editor.
package PMS;
import java.io.File;
import java.io.FileInputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Browse_java
static Connection con=null;
public static void main(String args[])
try{
System.out.println("(browse.java) just entered in to the class");
con = new PMS.DbConnection().getConnection();
System.out.println("(browse.java) connection string is"+con);
PreparedStatement ps = con.prepareStatement("INSERT INTO img_exp VALUES(?,?)");
System.out.println("(browse.java) prepare statement object is"+ps);
File file =new File("C:/Documents and Settings/Administrator/Desktop/Leader.jpg");
FileInputStream fs = new FileInputStream(file);
byte blob[]=new byte[(byte)file.length()];
fs.read(blob);
ps.setString(1,"C:/Documents and Settings/Administrator/Desktop/Leader.jpg");
ps.setBytes(2, blob);
System.out.println("(browse.java)length of picture is"+fs.available());
int i = ps.executeUpdate();
System.out.println("image inserted successfully"+i);
catch(Exception e)
e.printStackTrace();
finally
try {
con.close();
} catch (SQLException ex) {
ex.printStackTrace();
} -
hi friends,
please help me with sql statements to insert a image into a database using blob or longraw datatype.
suppose i have a image in c:\images\image.jpg.
thanks in advance.
Mohan.Hi Mohan Kumar,
Did you try inserting an
image using any frontend such
as Java?
Will get back to you if I get
anything concrete on your
problem.
Televis10 -
How to insert an image into mysql
welcome to all,
can any one tell how to insert an image into mysql database(BLOB). it is urgent.
regardswelcome to all,
can any one tell how to insert an image into mysql database(BLOB). it is urgent.
regards -
In Report 6i, Blob image not showing
i save blob image file in database using Oracle Form 6i.
and now i create report to display image.
Select id, Foto
from table
Image field is created, then i changed format type as image.
Now the error displaying when i execute report is
rep 1818: Unable to read data in image format
and rep: -619 you can not run without a layout.
Please help me.rep 1818: Unable to read data in image format
and rep: -619 you can not run without a layout.
this is the error -
How do i store and fetch image from the Database(Access)
i am facing one problem in inserting the image into the database.the steps i followed as
1)i have created one database(access) as "Image" and into that one table as "Image" and field as "image"
type of the field is ole object.
2)i have inserted one image into the image field through "database.vi"
3)now i am trying to get the image from the database by "Fetching Example.vi"
4)it will succesfully retrieve the image from that field .
5)but when i close the both programs and reopen those that time i am unable to get retrieve the image.
Attachments:
Add_to_Database.vi 78 KB
Fetch_from_database.vi 67 KBI would like to suggest different approach for saving the images in the database.
I was working on Medical Imaging Company. The way we save the images in real-time was by writing the name and path of the images to database.
The images themselves where saved directly to disk.
I don�t think that access is very good in taking care of GBytes of data.
It happens some time that the database gets damage. If you have the images separately you can create fix procedure. (We had one).
Good Lack,
Amit Shachaf, -
Use scanner or/and camera to insert image into oracle database BLOB feild
can any body show how i can do these? send me an example to do this?
notice: i'am using oracle form 6i & oracle databse 10g
best regards
hamdan
Edited by: user633386 on 05/07/2011 11:57 مIt's been discussed now and then. Hope this helps:
Insert Picture (image) using oracle forms
Looks like a keyword to search on is read_image_file
This all assumes that we know the name of the file. -
How to insert an image file in Oracle database
hi
can you please tell me how to insert an image file into oracle database????
suppose there is one image file in c:\pictures\rose.jpg. how to insert that file into database? theoretically i know that will be BFILE type but i dont know how to insert that.
will be waiting for your reply........
thanks & regards,
PriyatoshHello,
The easiest way to load a blob is to use SQL loader.
This example comes from the utilities guide:
LOAD DATA
INFILE 'sample.dat'
INTO TABLE person_table
FIELDS TERMINATED BY ','
(name CHAR(20),
1 ext_fname FILLER CHAR(40),
2 "RESUME" LOBFILE(ext_fname) TERMINATED BY EOF)
Datafile (sample.dat)
Johny Quest,jqresume.txt,
Speed Racer,'/private/sracer/srresume.txt',
Secondary Datafile (jqresume.txt)
Johny Quest
500 Oracle Parkway
Secondary Datafile (srresume.txt)
Loading LOBs
10-18 Oracle Database Utilities
Speed Racer
400 Oracle Parkway
regards,
Ivo -
How to insert a image file into oracle database
hi all
can anyone guide me how to insert a image file into oracle database now
i have created table using
create table imagestore(image blob);
but when inserting i totally lost don't know what to do how to write query to insert image fileHi I don't have time to explain really, I did have to do this a while ago though so I will post a code snippet. This is using the commons file upload framework.
Firstly you need a multi part form data (if you are using a web page). If you are not using a web page ignore this bit.
out.println("<form name=\"imgFrm\" method=\"post\" enctype=\"multipart/form-data\" action=\"FileUploadServlet?thisPageAction=reloaded\" onSubmit=\"return submitForm();\"><input type=\"FILE\" name=\"imgSource\" size='60' class='smalltext' onKeyPress='return stopUserInput();' onKeyUp='stopUserInput();' onKeyDown='stopUserInput();' onMouseDown='noMouseDown(event);'>");
out.println(" <input type='submit' name='submit' value='Submit' class='smalltext'>");
out.println("</form>"); Import this once you have the jar file:
import org.apache.commons.fileupload.*;Now a method I wrote to upload the file. I am not saying that this is correct, or its the best way to do this. I am just saying it works for me.
private boolean uploadFile(HttpServletRequest request, HttpSession session) throws Exception {
boolean result = true;
String fileName = null;
byte fileData[] = null;
String fileUploadError = null;
String imageType = "";
String error = "";
DiskFileUpload fb = new DiskFileUpload();
List fileItems = fb.parseRequest(request);
Iterator it = fileItems.iterator();
while(it.hasNext()){
FileItem fileItem = (FileItem)it.next();
if (!fileItem.isFormField()) {
fileName = fileItem.getName();
fileData = fileItem.get();
// Get the imageType from the filename extension
if (fileName != null) {
int dotPos = fileName.indexOf('.');
if (dotPos >= 0 && dotPos != fileName.length()-1) {
imageType = fileName.substring(dotPos+1).toLowerCase();
if (imageType.equals("jpg")) {
imageType = "jpeg";
String filePath = request.getParameter("FILE_PATH");
session.setAttribute("filePath", filePath);
session.setAttribute("fileData", fileData);
session.setAttribute("fileName", fileName);
session.setAttribute("imageType", imageType);
return result;
} And now finally the method to actually write the file to the database:
private int writeImageFile(byte[] fileData, String fileName, String imageType, String mode, Integer signatureIDIn, HttpServletRequest request) throws Exception {
//If the previous code found a file that can be uploaded then
//save it into the database via a pstmt
String sql = "";
UtilDBquery udbq = getUser(request).connectToDatabase();
Connection con = null;
int signatureID = 0;
PreparedStatement pstmt = null;
try {
udbq.setUsePreparedStatements(true);
con = udbq.getPooledConnection();
con.setAutoCommit(false);
if((!mode.equals("U")) || (mode.equals("U") && signatureIDIn == 0)) {
sql = "SELECT SEQ_SIGNATURE_ID.nextval FROM DUAL";
pstmt = con.prepareStatement(sql);
ResultSet rs = pstmt.executeQuery();
while(rs.next()) {
signatureID = rs.getInt(1);
if (fileName != null && imageType != null) {
sql = "INSERT INTO T_SIGNATURE (SIGNATURE_ID, SIGNATURE) values (?,?)";
InputStream is2 = new ByteArrayInputStream(fileData);
pstmt = con.prepareStatement(sql);
pstmt.setInt(1, signatureID);
pstmt.setBinaryStream(2, is2, (int)(fileData.length));
pstmt.executeUpdate();
pstmt.close();
con.commit();
con = null;
if(mode.equals("U") && signatureIDIn != 0) {
signatureID = signatureIDIn.intValue();
if (fileName != null && imageType != null) {
sql = "UPDATE T_SIGNATURE SET SIGNATURE = ? WHERE SIGNATURE_ID = ?";
InputStream is2 = new ByteArrayInputStream(fileData);
pstmt = con.prepareStatement(sql);
pstmt.setBinaryStream(1, is2, (int)(fileData.length));
pstmt.setInt(2, signatureID);
pstmt.executeUpdate();
pstmt.close();
con.commit();
con = null;
} catch (Exception e) {
con = null;
throw new Exception(e.toString());
return signatureID;
} -
How can I insert a image into a BLOB column in a table?
I am using forms6i against a 10gR2 database and I have one table with a BLOB column and I try to insert a image into this column. I get ORA-01461 error.
The curious case is that in another table with a BLOB column it works very fine.
What happens with the first table? How can I avoid the error?
Thanks in advance.Hi hyue,
Thanks for visiting Apple Support Communities.
If you would like to add an image to a project in iMovie for iOS, see this article for helpful steps:
iMovie for iOS (iPad): Add photos to a project
http://support.apple.com/kb/PH3171
All the best,
Jeremy
Maybe you are looking for
-
It keeps telling me that one of the USB devices for this computer has malfunctioned and windows does not recognize it. I have tried all of the ports and still am not having any luck. I have purchased 3 brand new cables and none of them are working.
-
Deleting photos from LR3 is excruciatingly slow
I'm finally getting around to cleaning up a catalog from last year that has several thousand photos that I don't want to keep. I am running into a strange behavior trying to delete these photos from within LR3. If I filter on only photos rated as one
-
Tap or Scroll? Understand the difference in AS3
Hello everyone, I'm developing apps for iOS with Adobe AIR since years but...I always had this big problem: how to make the app understand if I'm tapping something or if I'm just scrolling it? In my last product I basically have a scrolling menu with
-
Lost Old Laptop - how to move to 64 bit
I had a hard drive failure on my old laptop (Windows XP) now have a new laptop with Windows 7 that I'm trying to use to load iTunes and sync. It keeps telling me to load the 64-bit version but I think I did (clicked on 64 bit installer). Is there a
-
(x86) Inline assembler syntax errors for 8bit variables
Hello, I am porting some gcc code to Solaris and have some issues with the inline assembler. It works reasonably well on most of my code but with some instructions I have difficulties. In gcc, when I declare a variable as char/unsigned char and refer