---
title: "getGeneratedKeys()使用情况"
author: "fslingmo"
date: "2011-12-31T16:31:12Z"
tags: []
categories: ["编程语言"]
slug: "getgeneratedkeys"
draft: false
lastmod: "2011-12-31T16:31:12Z"
id: 1332215
url: "https://fslingmo.iteye.com/blog/1332215"
---

getGeneratedKeys()只能在sqlserver或mysql这种数据库中使用,oracle需要通过select seq.currVal from dual 来查找当前序列值,其中seq就是你写的序列的名称，在Oracle中使用会出现以下错误

java.sql.SQLException: 不允许的操作