Re: jdbc permissions

From: s_m_b (smb20002ns_at_hotmail.com)
Date: 02/24/04


Date: Tue, 24 Feb 2004 04:14:03 -0800


<anonymous@discussions.microsoft.com> wrote in news:1493501c3fa41
$8cbdc0d0$a301280a@phx.gbl:
well, this is the page from the helpfile thats caused me to ask:
'''''''''''''''''
Using the SQL Server 2000 Driver for JDBC on a Java 2 Platform

-------------------------------------------------------------------------
-------

When using the SQL Server 2000 Driver for JDBC on a Java 2 Platform with
the standard security manager enabled, you must give the driver some
additional permissions. Refer to your Java 2 Platform documentation for
more information about the Java 2 Platform security model and
permissions.

You can run an application on a Java 2 Platform with the standard
security manager using:

"java -Djava.security.manager application_class_name"

where application_class_name is the class name of the application.

Web browser applets running in the Java 2 plug-in are always running in a
Java Virtual Machine with the standard security manager enabled. To
enable the necessary permissions, you must add them to the security
policy file of the Java 2 Platform. This security policy file can be
found in the jre/lib/security subdirectory of the Java 2 Platform
installation directory.

To use JDBC data sources, all code bases must have the following
permissions:

// permissions granted to all domains
grant {
// DataSource access
permission java.util.PropertyPermission "java.naming.*", "read,write";
// Adjust the server host specification for your environment
permission java.net.SocketPermission "*.microsoft.com:0-65535",
"connect";
};

To use insensitive scrollable cursors, and perform client-side sorting of
some DatabaseMetaData ResultSets, all code bases must have access to
temporary files. If access to temporary files is not available, the
driver may throw an exception indicating that it is unable to set up a
static cursor cache.

For JDK 1.1 environments, access to "current working directory" must be
granted.

For Java 2 environments, access to the temporary directory specified by
the VM configuration must be granted.

The following is an example of permissions being granted for the C:\TEMP
directory:

// permissions granted to all domains
grant {
// Permission to create and delete temporary files.
// Adjust the temporary directory for your environment.
permission java.io.FilePermission "C:\\TEMP\\-", "read,write,delete";
};

''''''''''''''''''''''''''''''''

> Make sure you give sql permissions to the sql user you are
> using in your servlet to connect to sql server. There is
> no concept of giving read/write permissions to a jdbc
> driver.
>
> Let us know if you need more clarification on this or how
> to do it.
>

via the tomcat log, its failing to load the jdbc driver, but whether its
authentication or unable to find the driver, I'm not sure

 
> hth.
>
>>-----Original Message-----
>>seems precious few answers in the jdbc group...
>>as I'm trying to connect Tomcat 5 to MSDE, according to
> the help system, I
>>have to give the jdbc driver some read/write perms, but
> as the java is
>>actually a servlet, there is no codebase being used.
>>Anyone got any ideas on where I can set the permissions?
>>.
>>
>



Relevant Pages

  • Re: Possible Type Conversion Defect
    ... Specifically we are breaking due to the lack of conversion from BIGINT to ... Microsoft SQL Server 2000 JDBC driver. ... I'll agree that the JDBC API specifications could be a bit more precise. ... a JDBC driver attempts to convert the underlying data to the Java ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Microsoft Access DB Driver for JDBC
    ... The jdbc odbc bridge works but ... >> There is no JDBC driver for Access. ... > poster says it works) to allow Java apps to talk to any ODBC datasource. ...
    (comp.lang.java.programmer)
  • path question
    ... I'm just started off with databases and jdbc. ... I load the driver by: ... copy the com/org directories to some dir and include them in the java ... For the classpath as well, ...
    (comp.lang.java.databases)
  • Re: ClassNotFoundException
    ... > Java application, using JDBC. ... > 3) My Java app is on Windows XP Home; ... > driver installed and a CLASSPATH set before running DBPING" ... > c) I know CLASSPATH system variable isn't set. ...
    (comp.lang.java)
  • Re: CreateFile() returns ERROR_ACCESS_DENIED to the user
    ... grant permissions for power users on the device driver and then do a ... relogon with power user or there is some other place where the ... permissions can be granted? ... users cannot grant permissions to themselves, ...
    (microsoft.public.win32.programmer.kernel)